aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/LiveTv
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-01 12:45:57 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-08-01 12:45:57 -0400
commit4e52c027bcc2dc4cd100d450a7195233e48fb5ff (patch)
treecbdbf11ea02b91273c8e9ca80be14a58a58c285e /Emby.Server.Implementations/LiveTv
parenta74dbb64816817f30b2c2d65265ad757b1b0a569 (diff)
improve nextup queries
Diffstat (limited to 'Emby.Server.Implementations/LiveTv')
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs3
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs9
2 files changed, 7 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 9ac599846..99b5558a2 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -1632,7 +1632,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
return;
}
- var episodesToDelete = (librarySeries.GetItems(new InternalItemsQuery
+ var episodesToDelete = (librarySeries.GetItemList(new InternalItemsQuery
{
SortBy = new[] { ItemSortBy.DateCreated },
SortOrder = SortOrder.Descending,
@@ -1642,7 +1642,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
DtoOptions = new DtoOptions(true)
}))
- .Items
.Where(i => i.LocationType == LocationType.FileSystem && _fileSystem.FileExists(i.Path))
.Skip(seriesTimer.KeepUpTo - 1)
.ToList();
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 1f9817e20..10aab4054 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1845,6 +1845,9 @@ namespace Emby.Server.Implementations.LiveTv
public async Task AddInfoToProgramDto(List<Tuple<BaseItem, BaseItemDto>> tuples, List<ItemFields> fields, User user = null)
{
var programTuples = new List<Tuple<BaseItemDto, string, string, string>>();
+ var hasChannelImage = fields.Contains(ItemFields.ChannelImage);
+ var hasChannelInfo = fields.Contains(ItemFields.ChannelInfo);
+ var hasServiceName = fields.Contains(ItemFields.ServiceName);
foreach (var tuple in tuples)
{
@@ -1887,7 +1890,7 @@ namespace Emby.Server.Implementations.LiveTv
dto.IsPremiere = program.IsPremiere;
}
- if (fields.Contains(ItemFields.ChannelInfo))
+ if (hasChannelInfo || hasChannelImage)
{
var channel = GetInternalChannel(program.ChannelId);
@@ -1897,7 +1900,7 @@ namespace Emby.Server.Implementations.LiveTv
dto.MediaType = channel.MediaType;
dto.ChannelNumber = channel.Number;
- if (channel.HasImage(ImageType.Primary))
+ if (hasChannelImage && channel.HasImage(ImageType.Primary))
{
dto.ChannelPrimaryImageTag = _tvDtoService.GetImageTag(channel);
}
@@ -1906,7 +1909,7 @@ namespace Emby.Server.Implementations.LiveTv
var serviceName = program.ServiceName;
- if (fields.Contains(ItemFields.ServiceName))
+ if (hasServiceName)
{
dto.ServiceName = serviceName;
}