Collapse IsInEnabledFolder to single expression

Co-Authored-By: Vasily <JustAMan@users.noreply.github.com>
This commit is contained in:
PrplHaz4 2020-04-05 06:42:15 -04:00 committed by GitHub
parent 025888204d
commit b05e04c0cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)