The Free Software Media System - Server Backend & API
live tv updates
Luke Pulverentic0bbf8945ff0
diff --git a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs b/MediaBrowser.Controller/LiveTv/RecordingInfo.csindex 2004536af4..6a0d135c83 100644--- a/MediaBrowser.Controller/LiveTv/RecordingInfo.cs+++ b/MediaBrowser.Controller/LiveTv/RecordingInfo.cs@@ -22,11 +22,6 @@ namespace MediaBrowser.Controller.LiveTv/// </summary>public string ChannelId { get; set; }- /// <summary>- /// ChannelName of the recording.- /// </summary>- public string ChannelName { get; set; }-/// <summary>/// Gets or sets the type of the channel./// </summary>diff --git a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.csindex 6801cd7f9e..1be6549ff8 100644--- a/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs+++ b/MediaBrowser.Controller/LiveTv/SeriesTimerInfo.cs@@ -1,5 +1,4 @@-using MediaBrowser.Model.LiveTv;-using System;+using System;using System.Collections.Generic;namespace MediaBrowser.Controller.LiveTv@@ -16,11 +15,6 @@ namespace MediaBrowser.Controller.LiveTv/// </summary>public string ChannelId { get; set; }- /// <summary>- /// ChannelName of the recording.- /// </summary>- public string ChannelName { get; set; }-/// <summary>/// Gets or sets the program identifier./// </summary>diff --git a/MediaBrowser.Controller/LiveTv/TimerInfo.cs b/MediaBrowser.Controller/LiveTv/TimerInfo.csindex 499b217b5e..5d92a212f8 100644--- a/MediaBrowser.Controller/LiveTv/TimerInfo.cs+++ b/MediaBrowser.Controller/LiveTv/TimerInfo.cs@@ -21,11 +21,6 @@ namespace MediaBrowser.Controller.LiveTv/// </summary>public string ChannelId { get; set; }- /// <summary>- /// ChannelName of the recording.- /// </summary>- public string ChannelName { get; set; }-/// <summary>/// Gets or sets the program identifier./// </summary>diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.csindex b493fd15aa..dad0c915d7 100644--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs@@ -30,18 +30,17 @@ namespace MediaBrowser.Server.Implementations.LiveTv_logger = logger;}- public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program)+ public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel){var dto = new TimerInfoDto{Id = GetInternalTimerId(service.Name, info.Id).ToString("N"),- ChannelName = info.ChannelName,Overview = info.Overview,EndDate = info.EndDate,Name = info.Name,StartDate = info.StartDate,ExternalId = info.Id,- ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"),+ ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"),Status = info.Status,SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null : GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N"),PrePaddingSeconds = info.PrePaddingSeconds,@@ -69,15 +68,19 @@ namespace MediaBrowser.Server.Implementations.LiveTvdto.ProgramInfo.SeriesTimerId = dto.SeriesTimerId;}+ if (channel != null)+ {+ dto.ChannelName = channel.ChannelInfo.Name;+ }+return dto;}- public SeriesTimerInfoDto GetSeriesTimerInfoDto(SeriesTimerInfo info, ILiveTvService service)+ public SeriesTimerInfoDto GetSeriesTimerInfoDto(SeriesTimerInfo info, ILiveTvService service, string channelName){var dto = new SeriesTimerInfoDto{Id = GetInternalSeriesTimerId(service.Name, info.Id).ToString("N"),- ChannelName = info.ChannelName,Overview = info.Overview,EndDate = info.EndDate,Name = info.Name,@@ -94,12 +97,13 @@ namespace MediaBrowser.Server.Implementations.LiveTvRecordNewOnly = info.RecordNewOnly,ExternalChannelId = info.ChannelId,ExternalProgramId = info.ProgramId,- ServiceName = service.Name+ ServiceName = service.Name,+ ChannelName = channelName};if (!string.IsNullOrEmpty(info.ChannelId)){- dto.ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N");+ dto.ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N");}if (!string.IsNullOrEmpty(info.ProgramId))@@ -156,22 +160,21 @@ namespace MediaBrowser.Server.Implementations.LiveTvreturn val.Value * 2;}- public RecordingInfoDto GetRecordingInfoDto(LiveTvRecording recording, ILiveTvService service, User user = null)+ public RecordingInfoDto GetRecordingInfoDto(LiveTvRecording recording, LiveTvChannel channel, ILiveTvService service, User user = null){var info = recording.RecordingInfo;-+var dto = new RecordingInfoDto{Id = GetInternalRecordingId(service.Name, info.Id).ToString("N"),SeriesTimerId = string.IsNullOrEmpty(info.SeriesTimerId) ? null : GetInternalSeriesTimerId(service.Name, info.SeriesTimerId).ToString("N"),Type = recording.GetClientTypeName(),- ChannelName = info.ChannelName,Overview = info.Overview,EndDate = info.EndDate,Name = info.Name,StartDate = info.StartDate,ExternalId = info.Id,- ChannelId = GetInternalChannelId(service.Name, info.ChannelId, info.ChannelName).ToString("N"),+ ChannelId = GetInternalChannelId(service.Name, info.ChannelId).ToString("N"),Status = info.Status,Path = info.Path,Genres = info.Genres,@@ -212,6 +215,11 @@ namespace MediaBrowser.Server.Implementations.LiveTvdto.ProgramId = GetInternalProgramId(service.Name, info.ProgramId).ToString("N");}+ if (channel != null)+ {+ dto.ChannelName = channel.ChannelInfo.Name;+ }+return dto;}@@ -259,7 +267,7 @@ namespace MediaBrowser.Server.Implementations.LiveTvvar dto = new ProgramInfoDto{Id = GetInternalProgramId(item.ServiceName, program.Id).ToString("N"),- ChannelId = GetInternalChannelId(item.ServiceName, program.ChannelId, program.ChannelName).ToString("N"),+ ChannelId = GetInternalChannelId(item.ServiceName, program.ChannelId).ToString("N"),Overview = program.Overview,EndDate = program.EndDate,Genres = program.Genres,@@ -315,9 +323,9 @@ namespace MediaBrowser.Server.Implementations.LiveTvreturn null;}- public Guid GetInternalChannelId(string serviceName, string externalId, string channelName)+ public Guid GetInternalChannelId(string serviceName, string externalId){- var name = serviceName + externalId + channelName;+ var name = serviceName + externalId;return name.ToLower().GetMBId(typeof(LiveTvChannel));}@@ -354,7 +362,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv{var info = new TimerInfo{- ChannelName = dto.ChannelName,Overview = dto.Overview,EndDate = dto.EndDate,Name = dto.Name,@@ -416,7 +423,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv{var info = new SeriesTimerInfo{- ChannelName = dto.ChannelName,Overview = dto.Overview,EndDate = dto.EndDate,Name = dto.Name,diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.csindex d800b99480..281f38e872 100644--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs@@ -184,7 +184,7 @@ namespace MediaBrowser.Server.Implementations.LiveTvisNew = true;}- var id = _tvDtoService.GetInternalChannelId(serviceName, channelInfo.Id, channelInfo.Name);+ var id = _tvDtoService.GetInternalChannelId(serviceName, channelInfo.Id);var item = _itemRepo.RetrieveItem(id) as LiveTvChannel;@@ -295,8 +295,8 @@ namespace MediaBrowser.Server.Implementations.LiveTvprograms = programs.Where(i =>{var programChannelId = i.ProgramInfo.ChannelId;-- var internalProgramChannelId = _tvDtoService.GetInternalChannelId(serviceName, programChannelId, i.ProgramInfo.ChannelName);++ var internalProgramChannelId = _tvDtoService.GetInternalChannelId(serviceName, programChannelId);return guids.Contains(internalProgramChannelId);});@@ -426,7 +426,7 @@ namespace MediaBrowser.Server.Implementations.LiveTvif (!string.IsNullOrEmpty(query.ChannelId)){list = list- .Where(i => _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId, i.ChannelName) == new Guid(query.ChannelId))+ .Where(i => _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId) == new Guid(query.ChannelId)).ToList();}@@ -445,7 +445,11 @@ namespace MediaBrowser.Server.Implementations.LiveTv}var returnArray = entities- .Select(i => _tvDtoService.GetRecordingInfoDto(i, service, user))+ .Select(i =>+ {+ var channel = string.IsNullOrEmpty(i.RecordingInfo.ChannelId) ? null : GetInternalChannel(_tvDtoService.GetInternalChannelId(service.Name, i.RecordingInfo.ChannelId).ToString("N"));+ return _tvDtoService.GetRecordingInfoDto(i, channel, service, user);+ }).OrderByDescending(i => i.StartDate).ToArray();@@ -493,15 +497,16 @@ namespace MediaBrowser.Server.Implementations.LiveTvif (!string.IsNullOrEmpty(query.ChannelId)){var guid = new Guid(query.ChannelId);- timers = timers.Where(i => guid == _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId, i.ChannelName));+ timers = timers.Where(i => guid == _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId));}var returnArray = timers.Select(i =>{var program = string.IsNullOrEmpty(i.ProgramId) ? null : GetInternalProgram(_tvDtoService.GetInternalProgramId(service.Name, i.ProgramId).ToString("N"));+ var channel = string.IsNullOrEmpty(i.ChannelId) ? null : GetInternalChannel(_tvDtoService.GetInternalChannelId(service.Name, i.ChannelId).ToString("N"));- return _tvDtoService.GetTimerInfoDto(i, service, program);+ return _tvDtoService.GetTimerInfoDto(i, service, program, channel);}).OrderBy(i => i.StartDate).ToArray();@@ -591,7 +596,20 @@ namespace MediaBrowser.Server.Implementations.LiveTvvar timers = await service.GetSeriesTimersAsync(cancellationToken).ConfigureAwait(false);var returnArray = timers- .Select(i => _tvDtoService.GetSeriesTimerInfoDto(i, service))+ .Select(i =>+ {+ string channelName = null;++ if (!string.IsNullOrEmpty(i.ChannelId))+ {+ var internalChannelId = _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId);+ var channel = GetInternalChannel(internalChannelId.ToString("N"));+ channelName = channel == null ? null : channel.ChannelInfo.Name;+ }++ return _tvDtoService.GetSeriesTimerInfoDto(i, service, channelName);++ }).OrderByDescending(i => i.StartDate).ToArray();@@ -617,7 +635,7 @@ namespace MediaBrowser.Server.Implementations.LiveTvvar info = await service.GetNewTimerDefaultsAsync(cancellationToken).ConfigureAwait(false);- var obj = _tvDtoService.GetSeriesTimerInfoDto(info, service);+ var obj = _tvDtoService.GetSeriesTimerInfoDto(info, service, null);obj.Id = obj.ExternalId = string.Empty;diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.csindex 32df5fe132..2608ac1727 100644--- a/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs+++ b/MediaBrowser.Server.Implementations/ScheduledTasks/ChapterImagesTask.cs@@ -117,8 +117,6 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks/// <returns>IEnumerable{BaseTaskTrigger}.</returns>public IEnumerable<ITaskTrigger> GetDefaultTriggers(){- // IMPORTANT: Make sure to update the dashboard "wizardsettings" page if this default ever changes-return new ITaskTrigger[]{new DailyTrigger { TimeOfDay = TimeSpan.FromHours(4) }@@ -197,7 +195,6 @@ namespace MediaBrowser.Server.Implementations.ScheduledTasks{get{- // IMPORTANT: Make sure to update the dashboard "wizardsettings" page if this name ever changesreturn "Chapter image extraction";}}diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.csindex d3850017cd..dafa63f9ab 100644--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs@@ -547,6 +547,7 @@ namespace MediaBrowser.WebDashboard.Api"userprofilespage.js","usersettings.js","wizardfinishpage.js",+ "wizardimagesettings.js","wizardservice.js","wizardstartpage.js","wizardsettings.js",diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex bdf3476070..c6177969d4 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.289</version>+ <version>3.0.290</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.289" />+ <dependency id="MediaBrowser.Common" version="3.0.290" /><dependency id="NLog" version="2.1.0" /><dependency id="SimpleInjector" version="2.4.0" /><dependency id="sharpcompress" version="0.10.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex 7f5f649047..87411f9592 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.289</version>+ <version>3.0.290</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex d99d6be97a..fc944e2f20 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.289</version>+ <version>3.0.290</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.289" />+ <dependency id="MediaBrowser.Common" version="3.0.290" /></dependencies></metadata><files>