mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-04 22:24:35 -04:00
Applied Review Comments
This commit is contained in:
parent
b73985e04f
commit
05ffa7b413
@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
|
|
||||||
list.AddRange(GetInstantMixFromGenres(item.Genres, user, dtoOptions));
|
list.AddRange(GetInstantMixFromGenres(item.Genres, user, dtoOptions));
|
||||||
|
|
||||||
return list.ToImmutableList();
|
return [.. list];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
@ -393,21 +393,17 @@ public class InstantMixController : BaseJellyfinApiController
|
|||||||
|
|
||||||
private QueryResult<BaseItemDto> GetResult(IReadOnlyList<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
|
private QueryResult<BaseItemDto> GetResult(IReadOnlyList<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
|
||||||
{
|
{
|
||||||
var list = items;
|
var totalCount = items.Count;
|
||||||
|
|
||||||
var totalCount = list.Count;
|
if (limit.HasValue && limit < items.Count)
|
||||||
|
|
||||||
if (limit.HasValue && limit < list.Count)
|
|
||||||
{
|
{
|
||||||
list = list.Take(limit.Value).ToImmutableArray();
|
items = items.Take(limit.Value).ToImmutableArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
var returnList = _dtoService.GetBaseItemDtos(list, dtoOptions, user);
|
|
||||||
|
|
||||||
var result = new QueryResult<BaseItemDto>(
|
var result = new QueryResult<BaseItemDto>(
|
||||||
0,
|
0,
|
||||||
totalCount,
|
totalCount,
|
||||||
returnList);
|
_dtoService.GetBaseItemDtos(items, dtoOptions, user));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -120,13 +120,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
return "TvChannel";
|
return "TvChannel";
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<BaseItem> GetTaggedItems()
|
public IEnumerable<BaseItem> GetTaggedItems() => [];
|
||||||
=> Enumerable.Empty<BaseItem>();
|
|
||||||
|
|
||||||
public override IReadOnlyList<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
|
public override IReadOnlyList<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
|
||||||
{
|
{
|
||||||
var list = new List<MediaSourceInfo>();
|
|
||||||
|
|
||||||
var info = new MediaSourceInfo
|
var info = new MediaSourceInfo
|
||||||
{
|
{
|
||||||
Id = Id.ToString("N", CultureInfo.InvariantCulture),
|
Id = Id.ToString("N", CultureInfo.InvariantCulture),
|
||||||
@ -139,9 +136,7 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
IsInfiniteStream = RunTimeTicks is null
|
IsInfiniteStream = RunTimeTicks is null
|
||||||
};
|
};
|
||||||
|
|
||||||
list.Add(info);
|
return [info];
|
||||||
|
|
||||||
return list.ToImmutableList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IReadOnlyList<MediaStream> GetMediaStreams()
|
public override IReadOnlyList<MediaStream> GetMediaStreams()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user