fix vibrant

This commit is contained in:
Luke Pulverenti 2016-10-05 11:20:11 -04:00
parent b9cacd8076
commit 83606d82d5
2 changed files with 16 additions and 5 deletions

View File

@ -56,7 +56,8 @@ namespace Emby.Drawing.ImageMagick
"bmp",
"erf",
"raf",
"rw2"
"rw2",
"nrw"
};
}
}

View File

@ -558,11 +558,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return item;
}
private async Task<LiveTvProgram> GetProgram(ProgramInfo info, LiveTvChannel channel, ChannelType channelType, string serviceName, CancellationToken cancellationToken)
private async Task<LiveTvProgram> GetProgram(ProgramInfo info, Dictionary<Guid, LiveTvProgram> allExistingPrograms, LiveTvChannel channel, ChannelType channelType, string serviceName, CancellationToken cancellationToken)
{
var id = _tvDtoService.GetInternalProgramId(serviceName, info.Id);
var item = _libraryManager.GetItemById(id) as LiveTvProgram;
LiveTvProgram item = null;
allExistingPrograms.TryGetValue(id, out item);
var isNew = false;
var forceUpdate = false;
@ -1279,9 +1281,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv
var channelPrograms = await service.GetProgramsAsync(currentChannel.ExternalId, start, end, cancellationToken).ConfigureAwait(false);
var existingPrograms = _libraryManager.GetItemList(new InternalItemsQuery
{
IncludeItemTypes = new string[] { typeof(LiveTvProgram).Name },
ChannelIds = new string[] { currentChannel.Id.ToString("N") }
}).Cast<LiveTvProgram>().ToDictionary(i => i.Id);
foreach (var program in channelPrograms)
{
var programItem = await GetProgram(program, currentChannel, currentChannel.ChannelType, service.Name, cancellationToken).ConfigureAwait(false);
var programItem = await GetProgram(program, existingPrograms, currentChannel, currentChannel.ChannelType, service.Name, cancellationToken).ConfigureAwait(false);
programs.Add(programItem.Id);