From b05e04c0cb349e5e9e07ecc585b1388f71b85427 Mon Sep 17 00:00:00 2001 From: PrplHaz4 Date: Sun, 5 Apr 2020 06:42:15 -0400 Subject: [PATCH] Collapse IsInEnabledFolder to single expression Co-Authored-By: Vasily --- MediaBrowser.Api/UserLibrary/ItemsService.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Api/UserLibrary/ItemsService.cs b/MediaBrowser.Api/UserLibrary/ItemsService.cs index 46082cdc3f..7f24a5722d 100644 --- a/MediaBrowser.Api/UserLibrary/ItemsService.cs +++ b/MediaBrowser.Api/UserLibrary/ItemsService.cs @@ -213,10 +213,9 @@ namespace MediaBrowser.Api.UserLibrary request.IncludeItemTypes = "Playlist"; } - bool isInEnabledFolder = user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id); - - // Assume all folders inside an EnabledChannel are enabled - isInEnabledFolder = isInEnabledFolder || user.Policy.EnabledChannels.Any(i => new Guid(i) == item.Id); + bool isInEnabledFolder = user.Policy.EnabledFolders.Any(i => new Guid(i) == item.Id) || + // Assume all folders inside an EnabledChannel are enabled + user.Policy.EnabledChannels.Any(i => new Guid(i) == item.Id); var collectionFolders = _libraryManager.GetCollectionFolders(item); foreach (var collectionFolder in collectionFolders)