mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-16 05:36:52 +01:00
fix: filter for VideoTypes if Item is Iso file
This commit is contained in:
@@ -1076,8 +1076,11 @@ public sealed partial class BaseItemRepository
|
||||
|
||||
if (filter.VideoTypes.Length > 0)
|
||||
{
|
||||
// Dvds and Blu-rays can either be stored in a folder structure or as an iso file
|
||||
// => to find all matches we need to check both: VideoType and IsoType
|
||||
var videoTypeBs = filter.VideoTypes.Select(vt => $"\"VideoType\":\"{vt}\"").ToArray();
|
||||
Expression<Func<BaseItemEntity, bool>> hasVideoType = e => videoTypeBs.Any(f => e.Data!.Contains(f));
|
||||
var isoTypeBs = filter.VideoTypes.Select(vt => $"\"IsoType\":\"{vt}\"").ToArray();
|
||||
Expression<Func<BaseItemEntity, bool>> hasVideoType = e => videoTypeBs.Any(f => e.Data!.Contains(f)) || isoTypeBs.Any(f => e.Data!.Contains(f));
|
||||
baseQuery = baseQuery.WhereItemOrDescendantMatches(context, hasVideoType);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user