aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/UserViewManager.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2025-01-28 11:29:22 +0100
committerGitHub <noreply@github.com>2025-01-28 11:29:22 +0100
commitbcdffa74a80972f8493837fa911c9628598f7fa3 (patch)
tree9ce05e93dfed4339b86eea1b05620ad0a4635d07 /Emby.Server.Implementations/Library/UserViewManager.cs
parent0869a4f1f6e4b7cd327a0b14db08b070e963e776 (diff)
parenta70200af149eb5702178483d5bcc4d50a73e784f (diff)
Remove useless checks and dead code (#13405)
* Remove useless checks and dead code * Enable adaptive bitrate streaming again * Disable adaptive bitrate streaming by default
Diffstat (limited to 'Emby.Server.Implementations/Library/UserViewManager.cs')
-rw-r--r--Emby.Server.Implementations/Library/UserViewManager.cs30
1 files changed, 13 insertions, 17 deletions
diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs
index e9cf47d46..d42a0e7d2 100644
--- a/Emby.Server.Implementations/Library/UserViewManager.cs
+++ b/Emby.Server.Implementations/Library/UserViewManager.cs
@@ -308,39 +308,40 @@ namespace Emby.Server.Implementations.Library
}
}
- var mediaTypes = new List<MediaType>();
+ MediaType[] mediaTypes = [];
if (includeItemTypes.Length == 0)
{
+ HashSet<MediaType> tmpMediaTypes = [];
foreach (var parent in parents.OfType<ICollectionFolder>())
{
switch (parent.CollectionType)
{
case CollectionType.books:
- mediaTypes.Add(MediaType.Book);
- mediaTypes.Add(MediaType.Audio);
+ tmpMediaTypes.Add(MediaType.Book);
+ tmpMediaTypes.Add(MediaType.Audio);
break;
case CollectionType.music:
- mediaTypes.Add(MediaType.Audio);
+ tmpMediaTypes.Add(MediaType.Audio);
break;
case CollectionType.photos:
- mediaTypes.Add(MediaType.Photo);
- mediaTypes.Add(MediaType.Video);
+ tmpMediaTypes.Add(MediaType.Photo);
+ tmpMediaTypes.Add(MediaType.Video);
break;
case CollectionType.homevideos:
- mediaTypes.Add(MediaType.Photo);
- mediaTypes.Add(MediaType.Video);
+ tmpMediaTypes.Add(MediaType.Photo);
+ tmpMediaTypes.Add(MediaType.Video);
break;
default:
- mediaTypes.Add(MediaType.Video);
+ tmpMediaTypes.Add(MediaType.Video);
break;
}
}
- mediaTypes = mediaTypes.Distinct().ToList();
+ mediaTypes = tmpMediaTypes.ToArray();
}
- var excludeItemTypes = includeItemTypes.Length == 0 && mediaTypes.Count == 0
+ var excludeItemTypes = includeItemTypes.Length == 0 && mediaTypes.Length == 0
? new[]
{
BaseItemKind.Person,
@@ -366,14 +367,9 @@ namespace Emby.Server.Implementations.Library
Limit = limit * 5,
IsPlayed = isPlayed,
DtoOptions = options,
- MediaTypes = mediaTypes.ToArray()
+ MediaTypes = mediaTypes
};
- if (parents.Count == 0)
- {
- return _libraryManager.GetItemList(query, false);
- }
-
return _libraryManager.GetItemList(query, parents);
}
}