mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-13 13:46:24 +00:00
improve guide loading performance
This commit is contained in:
@@ -1767,11 +1767,6 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
{
|
||||
size = _imageProcessor.GetImageSize(imageInfo);
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
_logger.Error("Image file does not exist: {0}", path);
|
||||
return;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.ErrorException("Failed to determine primary image aspect ratio for {0}", ex, path);
|
||||
|
||||
@@ -77,6 +77,10 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (string.Equals(stream.Codec, "ssa", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -198,10 +198,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
/// Gets the channel info dto.
|
||||
/// </summary>
|
||||
/// <param name="info">The info.</param>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <param name="currentProgram">The current program.</param>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <returns>ChannelInfoDto.</returns>
|
||||
public ChannelInfoDto GetChannelInfoDto(LiveTvChannel info, LiveTvProgram currentProgram, User user = null)
|
||||
public ChannelInfoDto GetChannelInfoDto(LiveTvChannel info, DtoOptions options, LiveTvProgram currentProgram, User user = null)
|
||||
{
|
||||
var dto = new ChannelInfoDto
|
||||
{
|
||||
@@ -238,7 +239,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
if (currentProgram != null)
|
||||
{
|
||||
dto.CurrentProgram = _dtoService.GetBaseItemDto(currentProgram, new DtoOptions(), user);
|
||||
dto.CurrentProgram = _dtoService.GetBaseItemDto(currentProgram, options, user);
|
||||
}
|
||||
|
||||
return dto;
|
||||
|
||||
@@ -238,7 +238,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, CancellationToken cancellationToken)
|
||||
public async Task<QueryResult<ChannelInfoDto>> GetChannels(LiveTvChannelQuery query, DtoOptions options, CancellationToken cancellationToken)
|
||||
{
|
||||
var user = string.IsNullOrEmpty(query.UserId) ? null : _userManager.GetUserById(query.UserId);
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
var channelIdString = channel.Id.ToString("N");
|
||||
var currentProgram = programs.FirstOrDefault(i => string.Equals(i.ChannelId, channelIdString, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
returnList.Add(_tvDtoService.GetChannelInfoDto(channel, currentProgram, user));
|
||||
returnList.Add(_tvDtoService.GetChannelInfoDto(channel, options, currentProgram, user));
|
||||
}
|
||||
|
||||
var result = new QueryResult<ChannelInfoDto>
|
||||
@@ -762,7 +762,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
return dto;
|
||||
}
|
||||
|
||||
public async Task<QueryResult<BaseItemDto>> GetPrograms(ProgramQuery query, CancellationToken cancellationToken)
|
||||
public async Task<QueryResult<BaseItemDto>> GetPrograms(ProgramQuery query, DtoOptions options, CancellationToken cancellationToken)
|
||||
{
|
||||
var internalQuery = new InternalItemsQuery
|
||||
{
|
||||
@@ -822,7 +822,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
.Select(i =>
|
||||
{
|
||||
RefreshIfNeeded(i);
|
||||
return _dtoService.GetBaseItemDto(i, new DtoOptions(), user);
|
||||
return _dtoService.GetBaseItemDto(i, options, user);
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
@@ -907,14 +907,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, CancellationToken cancellationToken)
|
||||
public async Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken)
|
||||
{
|
||||
var internalResult = await GetRecommendedProgramsInternal(query, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
var user = _userManager.GetUserById(query.UserId);
|
||||
|
||||
var returnArray = internalResult.Items
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, new DtoOptions(), user))
|
||||
.Select(i => _dtoService.GetBaseItemDto(i, options, user))
|
||||
.ToArray();
|
||||
|
||||
await AddRecordingInfo(returnArray, cancellationToken).ConfigureAwait(false);
|
||||
@@ -1712,7 +1712,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
.OrderBy(i => i.StartDate)
|
||||
.FirstOrDefault();
|
||||
|
||||
var dto = _tvDtoService.GetChannelInfoDto(channel, currentProgram, user);
|
||||
var dto = _tvDtoService.GetChannelInfoDto(channel, new DtoOptions(), currentProgram, user);
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user