diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26f066153..2d1770b66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -233,10 +233,16 @@ jobs: python-version: '3.11' - name: Install Python Dependencies - run: pip install stability-matrix-tools>=0.2.15 + run: pip install stability-matrix-tools>=0.2.18 --upgrade - name: Publish Auto-Update Release - run: sm-tools updates publish-matrix-v3 -v ${{ github.event.inputs.version }} -y + env: + SM_B2_API_ID: ${{ secrets.SM_B2_API_ID }} + SM_B2_API_KEY: ${{ secrets.SM_B2_API_KEY }} + SM_CF_CACHE_PURGE_TOKEN: ${{ secrets.SM_CF_CACHE_PURGE_TOKEN }} + SM_CF_ZONE_ID: ${{ secrets.SM_CF_ZONE_ID }} + SM_SIGNING_PRIVATE_KEY: ${{ secrets.SM_SIGNING_PRIVATE_KEY }} + run: sm-tools updates publish-matrix-v3 -v $RELEASE_VERSION -y publish-auto-update-b2: name: Publish Auto-Update Release (B2) @@ -251,24 +257,23 @@ jobs: echo "Using version ${{ github.event.inputs.version }}" echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_ENV + # Downloads all previous artifacts to the current working directory + - name: Download Artifacts + uses: actions/download-artifact@v3 + + # Zip each build + - name: Zip Artifacts + run: | + cd StabilityMatrix-win-x64 && zip -r ../StabilityMatrix-win-x64.zip ./. && cd $OLDPWD + cd StabilityMatrix-linux-x64 && zip -r ../StabilityMatrix-linux-x64.zip ./. && cd $OLDPWD + - uses: actions/setup-python@v4 with: python-version: '3.11' - name: Install Python Dependencies - run: pip install stability-matrix-tools~=0.2.7 - - - name: Download Changelog - run: > - sm-tools updates download-changelog -v $RELEASE_VERSION -y - --changelog + run: pip install stability-matrix-tools>=0.2.18 --upgrade - # Zip each build - - name: Zip Artifacts - run: | - zip -r StabilityMatrix-win-x64.zip StabilityMatrix-win-x64/* - zip -r StabilityMatrix-linux-x64.zip StabilityMatrix-linux-x64/* - # Check that the zips and CHANGELOG.md are in the current working directory - name: Check files run: | @@ -286,10 +291,16 @@ jobs: fi - name: Publish Auto-Update Release + env: + SM_B2_API_ID: ${{ secrets.SM_B2_API_ID }} + SM_B2_API_KEY: ${{ secrets.SM_B2_API_KEY }} + SM_CF_CACHE_PURGE_TOKEN: ${{ secrets.SM_CF_CACHE_PURGE_TOKEN }} + SM_CF_ZONE_ID: ${{ secrets.SM_CF_ZONE_ID }} + SM_SIGNING_PRIVATE_KEY: ${{ secrets.SM_SIGNING_PRIVATE_KEY }} run: > - sm-tools updates publish-files-v3 -v $RELEASE_VERSION -y + sm-tools updates publish-files-v3 -v ${{ github.event.inputs.version }} --channel ${{ github.event.inputs.auto-update-release-channel }} --changelog CHANGELOG.md --win-x64 StabilityMatrix-win-x64.zip --linux-x64 StabilityMatrix-linux-x64.zip - --b2-bucket-name ${{ secrets.B2_BUCKET_NAME }} + -y diff --git a/CHANGELOG.md b/CHANGELOG.md index b687eaecc..41817ff04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). +## v2.6.6 +### Fixed +- Fixed [#297](https://github.com/LykosAI/StabilityMatrix/issues/297) - Model browser LiteAsyncException occuring when fetching entries with unrecognized values from enum name changes + ## v2.6.5 ### Fixed - Fixed error when receiving unknown model format values from the Model Browser diff --git a/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowserViewModel.cs b/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowserViewModel.cs index e76592588..10fc3263d 100644 --- a/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowserViewModel.cs +++ b/StabilityMatrix.Avalonia/ViewModels/CheckpointBrowserViewModel.cs @@ -15,6 +15,8 @@ using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using FluentAvalonia.UI.Controls; +using LiteDB; +using LiteDB.Async; using NLog; using Refit; using StabilityMatrix.Avalonia.Services; @@ -470,9 +472,31 @@ private async Task SearchModels() } // See if query is cached - var cachedQuery = await liteDbContext.CivitModelQueryCache - .IncludeAll() - .FindByIdAsync(ObjectHash.GetMd5Guid(modelRequest)); + CivitModelQueryCacheEntry? cachedQuery = null; + + try + { + cachedQuery = await liteDbContext.CivitModelQueryCache + .IncludeAll() + .FindByIdAsync(ObjectHash.GetMd5Guid(modelRequest)); + } + catch (Exception e) + { + // Suppress 'Training_Data' enum not found exceptions + // Caused by enum name change + // Ignore to do a new search to overwrite the cache + if ( + !( + e is LiteException or LiteAsyncException + && e.InnerException is ArgumentException inner + && inner.Message.Contains("Training_Data") + ) + ) + { + // Otherwise log error + Logger.Error(e, "Error while querying CivitModelQueryCache"); + } + } // If cached, update model cards if (cachedQuery is not null)