|
|
@ -26,6 +26,7 @@ using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using CommonIO;
|
|
|
|
using CommonIO;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Server.Implementations.Dto
|
|
|
|
namespace MediaBrowser.Server.Implementations.Dto
|
|
|
@ -92,11 +93,17 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|
|
|
var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems);
|
|
|
|
var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems);
|
|
|
|
|
|
|
|
|
|
|
|
var list = new List<BaseItemDto>();
|
|
|
|
var list = new List<BaseItemDto>();
|
|
|
|
|
|
|
|
var programTuples = new List<Tuple<BaseItem, BaseItemDto>> { };
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in items)
|
|
|
|
foreach (var item in items)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var dto = GetBaseItemDtoInternal(item, options, syncDictionary, user, owner);
|
|
|
|
var dto = GetBaseItemDtoInternal(item, options, syncDictionary, user, owner);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item is LiveTvProgram)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
programTuples.Add(new Tuple<BaseItem, BaseItemDto>(item, dto));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var byName = item as IItemByName;
|
|
|
|
var byName = item as IItemByName;
|
|
|
|
|
|
|
|
|
|
|
|
if (byName != null)
|
|
|
|
if (byName != null)
|
|
|
@ -118,6 +125,12 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|
|
|
list.Add(dto);
|
|
|
|
list.Add(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (programTuples.Count > 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var task = _livetvManager().AddInfoToProgramDto(programTuples, options.Fields, user);
|
|
|
|
|
|
|
|
Task.WaitAll(task);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return list;
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -139,6 +152,13 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|
|
|
|
|
|
|
|
|
|
|
var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user, owner);
|
|
|
|
var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user, owner);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item is LiveTvProgram)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var list = new List<Tuple<BaseItem, BaseItemDto>> { new Tuple<BaseItem, BaseItemDto>(item, dto) };
|
|
|
|
|
|
|
|
var task = _livetvManager().AddInfoToProgramDto(list, options.Fields, user);
|
|
|
|
|
|
|
|
Task.WaitAll(task);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var byName = item as IItemByName;
|
|
|
|
var byName = item as IItemByName;
|
|
|
|
|
|
|
|
|
|
|
|
if (byName != null)
|
|
|
|
if (byName != null)
|
|
|
@ -393,11 +413,6 @@ namespace MediaBrowser.Server.Implementations.Dto
|
|
|
|
_livetvManager().AddInfoToRecordingDto(item, dto, user);
|
|
|
|
_livetvManager().AddInfoToRecordingDto(item, dto, user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
else if (item is LiveTvProgram)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
_livetvManager().AddInfoToProgramDto(item, dto, fields, user);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dto;
|
|
|
|
return dto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|