diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-06-23 12:07:32 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2017-06-23 12:07:32 -0400 |
| commit | 023952d04df3765ee5574915f0a84903bb97a748 (patch) | |
| tree | 1a804fbb76aeb5205a065d3f742609e7bab4020e /Emby.Server.Implementations | |
| parent | 1e5c3db9eba730fe8b52995e5c699c22983fa62a (diff) | |
3.2.20.11
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/Dto/DtoService.cs | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.cs index 7352073bd..52ebd5e30 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<Tuple<BaseItem, BaseItemDto>>(); var channelTuples = new List<Tuple<BaseItemDto, LiveTvChannel>>(); + 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<Guid, Guid> 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<BaseItem> taggedItems, Dictionary<string, SyncedItemProgress> 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)) { |
