Skip to content

Commit

Permalink
fix: don't assume item id and library options are available
Browse files Browse the repository at this point in the history
Don't assume the `ItemId` and `LibraryOptions` are always available on `VirtualFolderInfo`. They can both be null if the library failed to be parsed.
  • Loading branch information
revam committed Oct 27, 2024
1 parent 3dff389 commit 5bd8f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shokofin/Configuration/MediaFolderConfigurationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ public async Task<MediaFolderConfiguration> GetOrCreateConfigurationForMediaFold
private async Task GenerateAllConfigurations(List<VirtualFolderInfo> allVirtualFolders)
{
var filteredVirtualFolders = allVirtualFolders
.Where(virtualFolder =>
.Where(virtualFolder =>
virtualFolder is { ItemId: not null, LibraryOptions: { } } &&
virtualFolder.CollectionType.ConvertToCollectionType() is null or CollectionType.movies or CollectionType.tvshows &&
Lookup.IsEnabledForLibraryOptions(virtualFolder.LibraryOptions, out _)
)
Expand Down

0 comments on commit 5bd8f17

Please sign in to comment.