mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
update translations
This commit is contained in:
@@ -533,6 +533,12 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
? null
|
||||
: _userManager.GetUserById(query.UserId);
|
||||
|
||||
// See below about parental control
|
||||
if (user != null)
|
||||
{
|
||||
query.StartIndex = null;
|
||||
}
|
||||
|
||||
var internalResult = await GetLatestChannelItemsInternal(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
// Get everything
|
||||
@@ -540,13 +546,27 @@ namespace MediaBrowser.Server.Implementations.Channels
|
||||
.Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true))
|
||||
.ToList();
|
||||
|
||||
var returnItems = internalResult.Items.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
var items = internalResult.Items;
|
||||
var totalRecordCount = internalResult.TotalRecordCount;
|
||||
|
||||
// Supporting parental control is a hack because it has to be done after querying the remote data source
|
||||
// This will get screwy if apps try to page, so limit to 10 results in an attempt to always keep them on the first page
|
||||
if (user != null)
|
||||
{
|
||||
items = items.Where(i => i.IsVisible(user))
|
||||
.Take(10)
|
||||
.ToArray();
|
||||
|
||||
totalRecordCount = items.Length;
|
||||
}
|
||||
|
||||
var returnItems = items.Select(i => _dtoService.GetBaseItemDto(i, fields, user))
|
||||
.ToArray();
|
||||
|
||||
var result = new QueryResult<BaseItemDto>
|
||||
{
|
||||
Items = returnItems,
|
||||
TotalRecordCount = internalResult.TotalRecordCount
|
||||
TotalRecordCount = totalRecordCount
|
||||
};
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user