From 61afd029dfbc3e3d7d14a980ce1682cfc8a04b94 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Sun, 14 Aug 2022 12:58:38 +0200 Subject: [PATCH] Check for empty guid --- Jellyfin.Api/Controllers/TvShowsController.cs | 2 +- MediaBrowser.Controller/Entities/Folder.cs | 4 ++-- MediaBrowser.Controller/Entities/UserViewBuilder.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Jellyfin.Api/Controllers/TvShowsController.cs b/Jellyfin.Api/Controllers/TvShowsController.cs index a74538b00..fc376d069 100644 --- a/Jellyfin.Api/Controllers/TvShowsController.cs +++ b/Jellyfin.Api/Controllers/TvShowsController.cs @@ -278,7 +278,7 @@ namespace Jellyfin.Api.Controllers } // This must be the last filter - if (adjacentTo.HasValue) + if (adjacentTo.HasValue && !adjacentTo.Value.Equals(default)) { episodes = UserViewBuilder.FilterForAdjacency(episodes, adjacentTo.Value).ToList(); } diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 7cab38a6c..1860da4c7 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -860,7 +860,7 @@ namespace MediaBrowser.Controller.Entities return true; } - if (query.AdjacentTo.HasValue) + if (query.AdjacentTo.HasValue && !query.AdjacentTo.Value.Equals(default)) { Logger.LogDebug("Query requires post-filtering due to AdjacentTo"); return true; @@ -1029,7 +1029,7 @@ namespace MediaBrowser.Controller.Entities #pragma warning restore CA1309 // This must be the last filter - if (query.AdjacentTo.HasValue) + if (query.AdjacentTo.HasValue && !query.AdjacentTo.Value.Equals(default)) { items = UserViewBuilder.FilterForAdjacency(items.ToList(), query.AdjacentTo.Value); } diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index 3a6b7ac2c..f467a6038 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -433,7 +433,7 @@ namespace MediaBrowser.Controller.Entities var user = query.User; // This must be the last filter - if (query.AdjacentTo.HasValue) + if (query.AdjacentTo.HasValue && !query.AdjacentTo.Value.Equals(default)) { items = FilterForAdjacency(items.ToList(), query.AdjacentTo.Value); }