diff options
Diffstat (limited to 'MediaBrowser.Controller/LiveTv')
6 files changed, 39 insertions, 49 deletions
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index be85e115c4..4934cc1ca8 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -76,16 +76,6 @@ namespace MediaBrowser.Controller.LiveTv void AddParts(IEnumerable<ILiveTvService> services, IEnumerable<ITunerHost> tunerHosts, IEnumerable<IListingsProvider> listingProviders); /// <summary> - /// Gets the recording. - /// </summary> - /// <param name="id">The identifier.</param> - /// <param name="options">The options.</param> - /// <param name="cancellationToken">The cancellation token.</param> - /// <param name="user">The user.</param> - /// <returns>Task{RecordingInfoDto}.</returns> - Task<BaseItemDto> GetRecording(string id, DtoOptions options, CancellationToken cancellationToken, User user = null); - - /// <summary> /// Gets the timer. /// </summary> /// <param name="id">The identifier.</param> @@ -236,14 +226,12 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="query">The query.</param> /// <param name="options">The options.</param> /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>Task{QueryResult{ProgramInfoDto}}.</returns> - Task<QueryResult<BaseItemDto>> GetRecommendedPrograms(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken); + QueryResult<BaseItemDto> GetRecommendedPrograms(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Gets the recommended programs internal. /// </summary> - /// <returns>Task<QueryResult<LiveTvProgram>>.</returns> - Task<QueryResult<BaseItem>> GetRecommendedProgramsInternal(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken); + QueryResult<BaseItem> GetRecommendedProgramsInternal(RecommendedProgramQuery query, DtoOptions options, CancellationToken cancellationToken); /// <summary> /// Gets the live tv information. @@ -264,8 +252,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets the live tv folder. /// </summary> /// <param name="cancellationToken">The cancellation token.</param> - /// <returns>BaseItemDto.</returns> - Task<Folder> GetInternalLiveTvFolder(CancellationToken cancellationToken); + Folder GetInternalLiveTvFolder(CancellationToken cancellationToken); /// <summary> /// Gets the live tv folder. @@ -273,7 +260,7 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="userId">The user identifier.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>BaseItemDto.</returns> - Task<BaseItemDto> GetLiveTvFolder(string userId, CancellationToken cancellationToken); + BaseItemDto GetLiveTvFolder(string userId, CancellationToken cancellationToken); /// <summary> /// Gets the enabled users. @@ -284,7 +271,7 @@ namespace MediaBrowser.Controller.LiveTv /// <summary> /// Gets the internal channels. /// </summary> - Task<QueryResult<BaseItem>> GetInternalChannels(LiveTvChannelQuery query, DtoOptions dtoOptions, CancellationToken cancellationToken); + QueryResult<BaseItem> GetInternalChannels(LiveTvChannelQuery query, DtoOptions dtoOptions, CancellationToken cancellationToken); /// <summary> /// Gets the internal recordings. @@ -362,13 +349,6 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="user">The user.</param> void AddChannelInfo(List<Tuple<BaseItemDto, LiveTvChannel>> items, DtoOptions options, User user); - /// <summary> - /// Called when [recording file deleted]. - /// </summary> - /// <param name="recording">The recording.</param> - /// <returns>Task.</returns> - Task OnRecordingFileDeleted(BaseItem recording); - Task<List<ChannelInfo>> GetChannelsForListingsProvider(string id, CancellationToken cancellationToken); Task<List<ChannelInfo>> GetChannelsFromListingsProviderData(string id, CancellationToken cancellationToken); diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs index 2019259c56..523eec24ac 100644 --- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs +++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs @@ -59,8 +59,8 @@ namespace MediaBrowser.Controller.LiveTv public interface ILiveStream { - Task Open(CancellationToken cancellationToken); - Task Close(); + Task Open(CancellationToken openCancellationToken); + void Close(); int ConsumerCount { get; } string OriginalStreamId { get; set; } bool EnableStreamSharing { get; set; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 8fa96076b7..bd84541f8f 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -132,7 +132,7 @@ namespace MediaBrowser.Controller.LiveTv return true; } - public override bool IsAuthorizedToDelete(User user) + public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) { return user.Policy.EnableLiveTvManagement; } @@ -161,10 +161,5 @@ namespace MediaBrowser.Controller.LiveTv { return LiveTvManager.DeleteRecording(this); } - - public override Task OnFileDeleted() - { - return LiveTvManager.OnRecordingFileDeleted(this); - } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs index 4a93d0399a..16010b7f5a 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvChannel.cs @@ -136,7 +136,8 @@ namespace MediaBrowser.Controller.LiveTv Name = Name, Path = Path, RunTimeTicks = RunTimeTicks, - Type = MediaSourceType.Placeholder + Type = MediaSourceType.Placeholder, + IsInfiniteStream = RunTimeTicks == null }; list.Add(info); diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 1c16373306..9dff18690e 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -50,21 +50,40 @@ namespace MediaBrowser.Controller.LiveTv public static double? GetDefaultPrimaryImageAspectRatio(IHasProgramAttributes item) { var serviceName = item.ServiceName; - if (!item.IsMovie - && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) - && !string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase)) + + if (item.IsMovie) { - double value = 16; - value /= 9; + if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase)) + { + double value = 2; + value /= 3; + + return value; + } + else + { + double value = 16; + value /= 9; - return value; + return value; + } } else { - double value = 2; - value /= 3; + if (string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || string.Equals(serviceName, "Next Pvr", StringComparison.OrdinalIgnoreCase)) + { + double value = 2; + value /= 3; - return value; + return value; + } + else + { + double value = 16; + value /= 9; + + return value; + } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index c5fe7b1b31..37c1faac6e 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -131,7 +131,7 @@ namespace MediaBrowser.Controller.LiveTv return true; } - public override bool IsAuthorizedToDelete(User user) + public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) { return user.Policy.EnableLiveTvManagement; } @@ -160,10 +160,5 @@ namespace MediaBrowser.Controller.LiveTv { return LiveTvManager.DeleteRecording(this); } - - public override Task OnFileDeleted() - { - return LiveTvManager.OnRecordingFileDeleted(this); - } } } |
