From 023952d04df3765ee5574915f0a84903bb97a748 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 23 Jun 2017 12:07:32 -0400 Subject: [PATCH] 3.2.20.11 --- Emby.Server.Implementations/Dto/DtoService.cs | 24 +++++++++++++++---- SharedVersion.cs | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7352073bd3..52ebd5e308 100644 --- a/Emby.Server.Implementations/Dto/DtoService.cs +++ b/Emby.Server.Implementations/Dto/DtoService.cs @@ -105,9 +105,13 @@ namespace Emby.Server.Implementations.Dto var programTuples = new List>(); var channelTuples = new List>(); + var refreshQueue = options.Fields.Contains(ItemFields.RefreshState) + ? _providerManager.GetRefreshQueue() + : null; + foreach (var item in items) { - var dto = GetBaseItemDtoInternal(item, options, user, owner); + var dto = GetBaseItemDtoInternal(item, options, refreshQueue, user, owner); var tvChannel = item as LiveTvChannel; if (tvChannel != null) @@ -160,7 +164,11 @@ namespace Emby.Server.Implementations.Dto { var syncDictionary = GetSyncedItemProgress(options); - var dto = GetBaseItemDtoInternal(item, options, user, owner); + var refreshQueue = options.Fields.Contains(ItemFields.RefreshState) + ? _providerManager.GetRefreshQueue() + : null; + + var dto = GetBaseItemDtoInternal(item, options, refreshQueue, user, owner); var tvChannel = item as LiveTvChannel; if (tvChannel != null) { @@ -292,7 +300,7 @@ namespace Emby.Server.Implementations.Dto } } - private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null) + private BaseItemDto GetBaseItemDtoInternal(BaseItem item, DtoOptions options, Dictionary currentRefreshQueue, User user = null, BaseItem owner = null) { var fields = options.Fields; @@ -392,6 +400,11 @@ namespace Emby.Server.Implementations.Dto dto.Etag = item.GetEtag(user); } + if (currentRefreshQueue != null) + { + //dto.RefreshState = item.GetRefreshState(currentRefreshQueue); + } + if (item is ILiveTvRecording) { _livetvManager().AddInfoToRecordingDto(item, dto, user); @@ -402,7 +415,10 @@ namespace Emby.Server.Implementations.Dto public BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List taggedItems, Dictionary syncProgress, User user = null) { - var dto = GetBaseItemDtoInternal(item, options, user); + var refreshQueue = options.Fields.Contains(ItemFields.RefreshState) + ? _providerManager.GetRefreshQueue() + : null; + var dto = GetBaseItemDtoInternal(item, options, refreshQueue, user); if (taggedItems != null && options.Fields.Contains(ItemFields.ItemCounts)) { diff --git a/SharedVersion.cs b/SharedVersion.cs index 7df961c8de..ec801ba7fe 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,3 +1,3 @@ using System.Reflection; -[assembly: AssemblyVersion("3.2.20.10")] +[assembly: AssemblyVersion("3.2.20.11")]