From e206f27839a573b357ebce972994586c2bfa8681 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 13 Jan 2014 15:31:09 -0500 Subject: add user permissions for managing tv recordings --- .../Library/Resolvers/TV/SeriesResolver.cs | 2 +- .../LiveTv/LiveTvManager.cs | 25 ++++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations') diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs index 121bf53d4..55a485318 100644 --- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs +++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/SeriesResolver.cs @@ -70,7 +70,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV } // Without these movies that have the name season in them could cause the parent folder to be resolved as a series - if (filename.IndexOf("[boxset]", StringComparison.OrdinalIgnoreCase) != -1 || filename.IndexOf("[tmdbid=", StringComparison.OrdinalIgnoreCase) != -1) + if (filename.IndexOf("[tmdbid=", StringComparison.OrdinalIgnoreCase) != -1) { return null; } diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index a8b62c5a7..b53b3b651 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1011,24 +1011,31 @@ namespace MediaBrowser.Server.Implementations.LiveTv .FirstOrDefault(); } - public async Task GetNewTimerDefaults(CancellationToken cancellationToken) + private async Task GetNewTimerDefaultsInternal(CancellationToken cancellationToken, ProgramInfo program = null) { - var service = ActiveService; + var info = await ActiveService.GetNewTimerDefaultsAsync(cancellationToken, program).ConfigureAwait(false); - var info = await service.GetNewTimerDefaultsAsync(cancellationToken).ConfigureAwait(false); + info.Id = null; - var obj = _tvDtoService.GetSeriesTimerInfoDto(info, service, null); + return info; + } + + public async Task GetNewTimerDefaults(CancellationToken cancellationToken) + { + var info = await GetNewTimerDefaultsInternal(cancellationToken).ConfigureAwait(false); - obj.Id = obj.ExternalId = string.Empty; + var obj = _tvDtoService.GetSeriesTimerInfoDto(info, ActiveService, null); return obj; } public async Task GetNewTimerDefaults(string programId, CancellationToken cancellationToken) { - var info = await GetNewTimerDefaults(cancellationToken).ConfigureAwait(false); + var program = GetInternalProgram(programId).ProgramInfo; + var programDto = await GetProgram(programId, cancellationToken).ConfigureAwait(false); - var program = await GetProgram(programId, cancellationToken).ConfigureAwait(false); + var defaults = await GetNewTimerDefaultsInternal(cancellationToken, program).ConfigureAwait(false); + var info = _tvDtoService.GetSeriesTimerInfoDto(defaults, ActiveService, null); info.Days = new List { @@ -1039,13 +1046,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv info.Name = program.Name; info.ChannelId = program.ChannelId; - info.ChannelName = program.ChannelName; + info.ChannelName = programDto.ChannelName; info.EndDate = program.EndDate; info.StartDate = program.StartDate; info.Name = program.Name; info.Overview = program.Overview; info.ProgramId = program.Id; - info.ExternalProgramId = program.ExternalId; + info.ExternalProgramId = programDto.ExternalId; return info; } -- cgit v1.2.3