The Free Software Media System - Server Backend & API
Don't die if folder doesn't have id
crobibero589625a3493e
diff --git a/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs b/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.csindex 42b87ec5f5..9137ea234e 100644--- a/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs+++ b/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs@@ -35,8 +35,14 @@ namespace Jellyfin.Server.Migrations.Routines_logger.LogInformation("Removing 'RemoveDownloadImagesInAdvance' settings in all the libraries");foreach (var virtualFolder in virtualFolders){+ // Some virtual folders don't have a proper item id.+ if (!Guid.TryParse(virtualFolder.ItemId, out var folderId))+ {+ continue;+ }+var libraryOptions = virtualFolder.LibraryOptions;- var collectionFolder = (CollectionFolder)_libraryManager.GetItemById(virtualFolder.ItemId);+ var collectionFolder = (CollectionFolder)_libraryManager.GetItemById(folderId);// The property no longer exists in LibraryOptions, so we just re-save the options to get old data removed.collectionFolder.UpdateLibraryOptions(libraryOptions);_logger.LogInformation("Removed from '{VirtualFolder}'", virtualFolder.Name);