mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-01 04:34:26 -04:00
Fix distinction queries (#14007)
This commit is contained in:
parent
67110b512a
commit
f576783ae1
@ -130,7 +130,7 @@ namespace Emby.Server.Implementations.IO
|
|||||||
private void ProcessPathChanges(List<string> paths)
|
private void ProcessPathChanges(List<string> paths)
|
||||||
{
|
{
|
||||||
IEnumerable<BaseItem> itemsToRefresh = paths
|
IEnumerable<BaseItem> itemsToRefresh = paths
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct()
|
||||||
.Select(GetAffectedBaseItem)
|
.Select(GetAffectedBaseItem)
|
||||||
.Where(item => item is not null)
|
.Where(item => item is not null)
|
||||||
.DistinctBy(x => x!.Id)!; // Removed null values in the previous .Where()
|
.DistinctBy(x => x!.Id)!; // Removed null values in the previous .Where()
|
||||||
|
@ -121,7 +121,7 @@ namespace Emby.Server.Implementations.IO
|
|||||||
.Where(IsLibraryMonitorEnabled)
|
.Where(IsLibraryMonitorEnabled)
|
||||||
.OfType<Folder>()
|
.OfType<Folder>()
|
||||||
.SelectMany(f => f.PhysicalLocations)
|
.SelectMany(f => f.PhysicalLocations)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct()
|
||||||
.Order();
|
.Order();
|
||||||
|
|
||||||
foreach (var path in paths)
|
foreach (var path in paths)
|
||||||
|
@ -668,10 +668,10 @@ namespace Emby.Server.Implementations.Library
|
|||||||
|
|
||||||
var list = originalList.Where(i => i.IsDirectory)
|
var list = originalList.Where(i => i.IsDirectory)
|
||||||
.Select(i => Path.TrimEndingDirectorySeparator(i.FullName))
|
.Select(i => Path.TrimEndingDirectorySeparator(i.FullName))
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.OrdinalIgnoreCase) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)))
|
var dupes = list.Where(subPath => !subPath.EndsWith(":\\", StringComparison.Ordinal) && list.Any(i => _fileSystem.ContainsSubPath(i, subPath)))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
foreach (var dupe in dupes)
|
foreach (var dupe in dupes)
|
||||||
@ -679,7 +679,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
_logger.LogInformation("Found duplicate path: {0}", dupe);
|
_logger.LogInformation("Found duplicate path: {0}", dupe);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newList = list.Except(dupes, StringComparer.OrdinalIgnoreCase).Select(_fileSystem.GetDirectoryInfo).ToList();
|
var newList = list.Except(dupes, StringComparer.Ordinal).Select(_fileSystem.GetDirectoryInfo).ToList();
|
||||||
newList.AddRange(originalList.Where(i => !i.IsDirectory));
|
newList.AddRange(originalList.Where(i => !i.IsDirectory));
|
||||||
return newList;
|
return newList;
|
||||||
}
|
}
|
||||||
|
@ -299,7 +299,7 @@ public class ItemUpdateController : BaseJellyfinApiController
|
|||||||
|
|
||||||
if (!season.LockedFields.Contains(MetadataField.Tags))
|
if (!season.LockedFields.Contains(MetadataField.Tags))
|
||||||
{
|
{
|
||||||
season.Tags = season.Tags.Concat(addedTags).Except(removedTags).Distinct().ToArray();
|
season.Tags = season.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
season.OnMetadataChanged();
|
season.OnMetadataChanged();
|
||||||
@ -316,7 +316,7 @@ public class ItemUpdateController : BaseJellyfinApiController
|
|||||||
|
|
||||||
if (!ep.LockedFields.Contains(MetadataField.Tags))
|
if (!ep.LockedFields.Contains(MetadataField.Tags))
|
||||||
{
|
{
|
||||||
ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct().ToArray();
|
ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
ep.OnMetadataChanged();
|
ep.OnMetadataChanged();
|
||||||
@ -337,7 +337,7 @@ public class ItemUpdateController : BaseJellyfinApiController
|
|||||||
|
|
||||||
if (!ep.LockedFields.Contains(MetadataField.Tags))
|
if (!ep.LockedFields.Contains(MetadataField.Tags))
|
||||||
{
|
{
|
||||||
ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct().ToArray();
|
ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
ep.OnMetadataChanged();
|
ep.OnMetadataChanged();
|
||||||
@ -357,7 +357,7 @@ public class ItemUpdateController : BaseJellyfinApiController
|
|||||||
|
|
||||||
if (!track.LockedFields.Contains(MetadataField.Tags))
|
if (!track.LockedFields.Contains(MetadataField.Tags))
|
||||||
{
|
{
|
||||||
track.Tags = track.Tags.Concat(addedTags).Except(removedTags).Distinct().ToArray();
|
track.Tags = track.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
track.OnMetadataChanged();
|
track.OnMetadataChanged();
|
||||||
|
@ -223,6 +223,6 @@ public class YearsController : BaseJellyfinApiController
|
|||||||
.Select(i => i.ProductionYear ?? 0)
|
.Select(i => i.ProductionYear ?? 0)
|
||||||
.Where(i => i > 0)
|
.Where(i => i > 0)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.Select(year => _libraryManager.GetYear(year));
|
.Select(_libraryManager.GetYear);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1804,7 +1804,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
public void SetStudios(IEnumerable<string> names)
|
public void SetStudios(IEnumerable<string> names)
|
||||||
{
|
{
|
||||||
Studios = names.Trimmed().Distinct().ToArray();
|
Studios = names.Trimmed().Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -197,7 +197,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
var expandedFolders = new List<Guid>();
|
var expandedFolders = new List<Guid>();
|
||||||
|
|
||||||
return FlattenItems(this, expandedFolders)
|
return FlattenItems(this, expandedFolders)
|
||||||
.SelectMany(i => LibraryManager.GetCollectionFolders(i))
|
.SelectMany(LibraryManager.GetCollectionFolders)
|
||||||
.Select(i => i.Id)
|
.Select(i => i.Id)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
@ -14,8 +14,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
{
|
{
|
||||||
public partial class EncoderValidator
|
public partial class EncoderValidator
|
||||||
{
|
{
|
||||||
private static readonly string[] _requiredDecoders = new[]
|
private static readonly string[] _requiredDecoders =
|
||||||
{
|
[
|
||||||
"h264",
|
"h264",
|
||||||
"hevc",
|
"hevc",
|
||||||
"vp8",
|
"vp8",
|
||||||
@ -57,10 +57,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
"vp8_rkmpp",
|
"vp8_rkmpp",
|
||||||
"vp9_rkmpp",
|
"vp9_rkmpp",
|
||||||
"av1_rkmpp"
|
"av1_rkmpp"
|
||||||
};
|
];
|
||||||
|
|
||||||
private static readonly string[] _requiredEncoders = new[]
|
private static readonly string[] _requiredEncoders =
|
||||||
{
|
[
|
||||||
"libx264",
|
"libx264",
|
||||||
"libx265",
|
"libx265",
|
||||||
"libsvtav1",
|
"libsvtav1",
|
||||||
@ -97,10 +97,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
"h264_rkmpp",
|
"h264_rkmpp",
|
||||||
"hevc_rkmpp",
|
"hevc_rkmpp",
|
||||||
"mjpeg_rkmpp"
|
"mjpeg_rkmpp"
|
||||||
};
|
];
|
||||||
|
|
||||||
private static readonly string[] _requiredFilters = new[]
|
private static readonly string[] _requiredFilters =
|
||||||
{
|
[
|
||||||
// sw
|
// sw
|
||||||
"alphasrc",
|
"alphasrc",
|
||||||
"zscale",
|
"zscale",
|
||||||
@ -148,7 +148,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
"scale_rkrga",
|
"scale_rkrga",
|
||||||
"vpp_rkrga",
|
"vpp_rkrga",
|
||||||
"overlay_rkrga"
|
"overlay_rkrga"
|
||||||
};
|
];
|
||||||
|
|
||||||
private static readonly Dictionary<int, string[]> _filterOptionsDict = new Dictionary<int, string[]>
|
private static readonly Dictionary<int, string[]> _filterOptionsDict = new Dictionary<int, string[]>
|
||||||
{
|
{
|
||||||
@ -471,10 +471,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(output))
|
if (string.IsNullOrWhiteSpace(output))
|
||||||
{
|
{
|
||||||
return Enumerable.Empty<string>();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var found = output.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).Skip(1).Distinct().ToList();
|
var found = output.Split(['\r', '\n'], StringSplitOptions.RemoveEmptyEntries).Skip(1).Distinct().ToList();
|
||||||
_logger.LogInformation("Available hwaccel types: {Types}", found);
|
_logger.LogInformation("Available hwaccel types: {Types}", found);
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
@ -580,12 +580,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error detecting available {Codec}", codecstr);
|
_logger.LogError(ex, "Error detecting available {Codec}", codecstr);
|
||||||
return Enumerable.Empty<string>();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(output))
|
if (string.IsNullOrWhiteSpace(output))
|
||||||
{
|
{
|
||||||
return Enumerable.Empty<string>();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var required = codec == Codec.Encoder ? _requiredEncoders : _requiredDecoders;
|
var required = codec == Codec.Encoder ? _requiredEncoders : _requiredDecoders;
|
||||||
@ -610,12 +610,12 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error detecting available filters");
|
_logger.LogError(ex, "Error detecting available filters");
|
||||||
return Enumerable.Empty<string>();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(output))
|
if (string.IsNullOrWhiteSpace(output))
|
||||||
{
|
{
|
||||||
return Enumerable.Empty<string>();
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
var found = FilterRegex()
|
var found = FilterRegex()
|
||||||
|
@ -1041,7 +1041,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.Studios = target.Studios.Concat(source.Studios).Distinct().ToArray();
|
target.Studios = target.Studios.Concat(source.Studios).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1053,7 +1053,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.Tags = target.Tags.Concat(source.Tags).Distinct().ToArray();
|
target.Tags = target.Tags.Concat(source.Tags).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1065,7 +1065,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target.ProductionLocations = target.ProductionLocations.Concat(source.ProductionLocations).Distinct().ToArray();
|
target.ProductionLocations = target.ProductionLocations.Concat(source.ProductionLocations).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1214,7 +1214,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
}
|
}
|
||||||
else if (sourceHasAlbumArtist.AlbumArtists.Count > 0)
|
else if (sourceHasAlbumArtist.AlbumArtists.Count > 0)
|
||||||
{
|
{
|
||||||
targetHasAlbumArtist.AlbumArtists = targetHasAlbumArtist.AlbumArtists.Concat(sourceHasAlbumArtist.AlbumArtists).Distinct().ToArray();
|
targetHasAlbumArtist.AlbumArtists = targetHasAlbumArtist.AlbumArtists.Concat(sourceHasAlbumArtist.AlbumArtists).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ namespace MediaBrowser.Providers.Music
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct().ToArray();
|
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replaceData || string.IsNullOrEmpty(targetItem.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist)))
|
if (replaceData || string.IsNullOrEmpty(targetItem.GetProviderId(MetadataProvider.MusicBrainzAlbumArtist)))
|
||||||
|
@ -63,7 +63,7 @@ namespace MediaBrowser.Providers.Music
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct().ToArray();
|
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replaceData || string.IsNullOrEmpty(targetItem.Album))
|
if (replaceData || string.IsNullOrEmpty(targetItem.Album))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
@ -48,7 +49,7 @@ namespace MediaBrowser.Providers.Music
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct().ToArray();
|
targetItem.Artists = targetItem.Artists.Concat(sourceItem.Artists).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ public class PlaylistItemsProvider : ILocalMetadataProvider<Playlist>,
|
|||||||
.OfType<CollectionFolder>()
|
.OfType<CollectionFolder>()
|
||||||
.Where(f => f.CollectionType.HasValue && !_ignoredCollections.Contains(f.CollectionType.Value))
|
.Where(f => f.CollectionType.HasValue && !_ignoredCollections.Contains(f.CollectionType.Value))
|
||||||
.SelectMany(f => f.PhysicalLocations)
|
.SelectMany(f => f.PhysicalLocations)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct()
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
using (var stream = File.OpenRead(path))
|
using (var stream = File.OpenRead(path))
|
||||||
|
@ -125,8 +125,8 @@ namespace Jellyfin.LiveTv
|
|||||||
IsKids = query.IsKids,
|
IsKids = query.IsKids,
|
||||||
IsSports = query.IsSports,
|
IsSports = query.IsSports,
|
||||||
IsSeries = query.IsSeries,
|
IsSeries = query.IsSeries,
|
||||||
IncludeItemTypes = new[] { BaseItemKind.LiveTvChannel },
|
IncludeItemTypes = [BaseItemKind.LiveTvChannel],
|
||||||
TopParentIds = new[] { topFolder.Id },
|
TopParentIds = [topFolder.Id],
|
||||||
IsFavorite = query.IsFavorite,
|
IsFavorite = query.IsFavorite,
|
||||||
IsLiked = query.IsLiked,
|
IsLiked = query.IsLiked,
|
||||||
StartIndex = query.StartIndex,
|
StartIndex = query.StartIndex,
|
||||||
@ -199,17 +199,17 @@ namespace Jellyfin.LiveTv
|
|||||||
if (query.OrderBy.Count == 0)
|
if (query.OrderBy.Count == 0)
|
||||||
{
|
{
|
||||||
// Unless something else was specified, order by start date to take advantage of a specialized index
|
// Unless something else was specified, order by start date to take advantage of a specialized index
|
||||||
query.OrderBy = new[]
|
query.OrderBy =
|
||||||
{
|
[
|
||||||
(ItemSortBy.StartDate, SortOrder.Ascending)
|
(ItemSortBy.StartDate, SortOrder.Ascending)
|
||||||
};
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveFields(options);
|
RemoveFields(options);
|
||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
IncludeItemTypes = [BaseItemKind.LiveTvProgram],
|
||||||
MinEndDate = query.MinEndDate,
|
MinEndDate = query.MinEndDate,
|
||||||
MinStartDate = query.MinStartDate,
|
MinStartDate = query.MinStartDate,
|
||||||
MaxEndDate = query.MaxEndDate,
|
MaxEndDate = query.MaxEndDate,
|
||||||
@ -226,7 +226,7 @@ namespace Jellyfin.LiveTv
|
|||||||
Limit = query.Limit,
|
Limit = query.Limit,
|
||||||
OrderBy = query.OrderBy,
|
OrderBy = query.OrderBy,
|
||||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||||
TopParentIds = new[] { topFolder.Id },
|
TopParentIds = [topFolder.Id],
|
||||||
Name = query.Name,
|
Name = query.Name,
|
||||||
DtoOptions = options,
|
DtoOptions = options,
|
||||||
HasAired = query.HasAired,
|
HasAired = query.HasAired,
|
||||||
@ -272,7 +272,7 @@ namespace Jellyfin.LiveTv
|
|||||||
|
|
||||||
var internalQuery = new InternalItemsQuery(user)
|
var internalQuery = new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
IncludeItemTypes = [BaseItemKind.LiveTvProgram],
|
||||||
IsAiring = query.IsAiring,
|
IsAiring = query.IsAiring,
|
||||||
HasAired = query.HasAired,
|
HasAired = query.HasAired,
|
||||||
IsNews = query.IsNews,
|
IsNews = query.IsNews,
|
||||||
@ -281,8 +281,8 @@ namespace Jellyfin.LiveTv
|
|||||||
IsSports = query.IsSports,
|
IsSports = query.IsSports,
|
||||||
IsKids = query.IsKids,
|
IsKids = query.IsKids,
|
||||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||||
OrderBy = new[] { (ItemSortBy.StartDate, SortOrder.Ascending) },
|
OrderBy = [(ItemSortBy.StartDate, SortOrder.Ascending)],
|
||||||
TopParentIds = new[] { topFolder.Id },
|
TopParentIds = [topFolder.Id],
|
||||||
DtoOptions = options,
|
DtoOptions = options,
|
||||||
GenreIds = query.GenreIds
|
GenreIds = query.GenreIds
|
||||||
};
|
};
|
||||||
@ -497,19 +497,19 @@ namespace Jellyfin.LiveTv
|
|||||||
// TotalRecordCount = items.Length
|
// TotalRecordCount = items.Length
|
||||||
// };
|
// };
|
||||||
|
|
||||||
dtoOptions.Fields = dtoOptions.Fields.Concat(new[] { ItemFields.Tags }).Distinct().ToArray();
|
dtoOptions.Fields = dtoOptions.Fields.Concat([ItemFields.Tags]).Distinct().ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = _libraryManager.GetItemsResult(new InternalItemsQuery(user)
|
var result = _libraryManager.GetItemsResult(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
MediaTypes = new[] { MediaType.Video },
|
MediaTypes = [MediaType.Video],
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
AncestorIds = folderIds,
|
AncestorIds = folderIds,
|
||||||
IsFolder = false,
|
IsFolder = false,
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
Limit = limit,
|
Limit = limit,
|
||||||
StartIndex = query.StartIndex,
|
StartIndex = query.StartIndex,
|
||||||
OrderBy = new[] { (ItemSortBy.DateCreated, SortOrder.Descending) },
|
OrderBy = [(ItemSortBy.DateCreated, SortOrder.Descending)],
|
||||||
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
EnableTotalRecordCount = query.EnableTotalRecordCount,
|
||||||
IncludeItemTypes = includeItemTypes.ToArray(),
|
IncludeItemTypes = includeItemTypes.ToArray(),
|
||||||
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
||||||
@ -959,13 +959,13 @@ namespace Jellyfin.LiveTv
|
|||||||
|
|
||||||
var programs = options.AddCurrentProgram ? _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var programs = options.AddCurrentProgram ? _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
IncludeItemTypes = new[] { BaseItemKind.LiveTvProgram },
|
IncludeItemTypes = [BaseItemKind.LiveTvProgram],
|
||||||
ChannelIds = channelIds,
|
ChannelIds = channelIds,
|
||||||
MaxStartDate = now,
|
MaxStartDate = now,
|
||||||
MinEndDate = now,
|
MinEndDate = now,
|
||||||
Limit = channelIds.Length,
|
Limit = channelIds.Length,
|
||||||
OrderBy = new[] { (ItemSortBy.StartDate, SortOrder.Ascending) },
|
OrderBy = [(ItemSortBy.StartDate, SortOrder.Ascending)],
|
||||||
TopParentIds = new[] { GetInternalLiveTvFolder(CancellationToken.None).Id },
|
TopParentIds = [GetInternalLiveTvFolder(CancellationToken.None).Id],
|
||||||
DtoOptions = options
|
DtoOptions = options
|
||||||
}) : new List<BaseItem>();
|
}) : new List<BaseItem>();
|
||||||
|
|
||||||
@ -1269,7 +1269,7 @@ namespace Jellyfin.LiveTv
|
|||||||
{
|
{
|
||||||
var folders = _recordingsManager.GetRecordingFolders()
|
var folders = _recordingsManager.GetRecordingFolders()
|
||||||
.SelectMany(i => i.Locations)
|
.SelectMany(i => i.Locations)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct()
|
||||||
.Select(i => _libraryManager.FindByPath(i, true))
|
.Select(i => _libraryManager.FindByPath(i, true))
|
||||||
.Where(i => i is not null && i.IsVisibleStandalone(user))
|
.Where(i => i is not null && i.IsVisibleStandalone(user))
|
||||||
.SelectMany(i => _libraryManager.GetCollectionFolders(i))
|
.SelectMany(i => _libraryManager.GetCollectionFolders(i))
|
||||||
|
@ -230,7 +230,7 @@ public sealed class RecordingsManager : IRecordingsManager, IDisposable
|
|||||||
if (pathsAdded.Count > 0 || pathsToRemove.Count > 0)
|
if (pathsAdded.Count > 0 || pathsToRemove.Count > 0)
|
||||||
{
|
{
|
||||||
pathsAdded.InsertRange(0, config.MediaLocationsCreated);
|
pathsAdded.InsertRange(0, config.MediaLocationsCreated);
|
||||||
config.MediaLocationsCreated = pathsAdded.Except(pathsToRemove).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
|
config.MediaLocationsCreated = pathsAdded.Except(pathsToRemove).Distinct().ToArray();
|
||||||
_config.SaveConfiguration("livetv", config);
|
_config.SaveConfiguration("livetv", config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user