diff options
| author | crobibero <cody@robibe.ro> | 2020-12-01 17:36:36 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-01 17:36:36 -0700 |
| commit | 589625a3493e15c33d8233c345e777fb08decbdf (patch) | |
| tree | 0fd5ae371664e876de0c5bf4bf6119a905dfba4f | |
| parent | 28373504da001b44aa5b19deee986bfde4776912 (diff) | |
Don't die if folder doesn't have id
| -rw-r--r-- | Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs b/Jellyfin.Server/Migrations/Routines/RemoveDownloadImagesInAdvance.cs index 42b87ec5f..9137ea234 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); |
