diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-28 00:47:30 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-28 00:47:30 -0400 |
| commit | bbdd2c5f6a1ce4640d3e11e158c3630f701419c2 (patch) | |
| tree | 844cd094bbdb96533574d5a0217061a3e004a8af /MediaBrowser.Server.Implementations/LiveTv | |
| parent | c1e83beeac9c71481c6f1e0d6d0cad8a6c384fbe (diff) | |
update xmltv
Diffstat (limited to 'MediaBrowser.Server.Implementations/LiveTv')
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs | 14 | ||||
| -rw-r--r-- | MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 14 |
2 files changed, 25 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs index 14e4e1093..4d24431e6 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/Listings/XmlTvListingsProvider.cs @@ -11,6 +11,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Emby.XmlTv.Classes; +using Emby.XmlTv.Entities; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; @@ -109,12 +110,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings return results.Select(p => new ProgramInfo() { ChannelId = p.ChannelId, - EndDate = p.EndDate, + EndDate = GetDate(p.EndDate), EpisodeNumber = p.Episode == null ? null : p.Episode.Episode, EpisodeTitle = p.Episode == null ? null : p.Episode.Title, Genres = p.Categories, Id = String.Format("{0}_{1:O}", p.ChannelId, p.StartDate), // Construct an id from the channel and start date, - StartDate = p.StartDate, + StartDate = GetDate(p.StartDate), Name = p.Title, Overview = p.Description, ShortOverview = p.Description, @@ -135,6 +136,15 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings }); } + private DateTime GetDate(DateTime date) + { + if (date.Kind != DateTimeKind.Utc) + { + date = DateTime.SpecifyKind(date, DateTimeKind.Utc); + } + return date; + } + public async Task AddMetadata(ListingsProviderInfo info, List<ChannelInfo> channels, CancellationToken cancellationToken) { // Add the channel image url diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 95ed2aac1..8d361e6a0 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -656,7 +656,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.Audio = info.Audio; item.ChannelId = channel.Id.ToString("N"); item.CommunityRating = item.CommunityRating ?? info.CommunityRating; - item.EndDate = info.EndDate; + item.EpisodeTitle = info.EpisodeTitle; item.ExternalId = info.Id; item.Genres = info.Genres; @@ -673,7 +673,19 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.OfficialRating = item.OfficialRating ?? info.OfficialRating; item.Overview = item.Overview ?? info.Overview; item.RunTimeTicks = (info.EndDate - info.StartDate).Ticks; + + if (item.StartDate != info.StartDate) + { + forceUpdate = true; + } item.StartDate = info.StartDate; + + if (item.EndDate != info.EndDate) + { + forceUpdate = true; + } + item.EndDate = info.EndDate; + item.HomePageUrl = info.HomePageUrl; item.ProductionYear = info.ProductionYear; |
