diff options
| author | Cody Robibero <cody@robibe.ro> | 2024-02-20 10:44:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-20 10:44:46 -0800 |
| commit | 31715c6b8a0d1f9f9d9f2849b03e6312d9000e7c (patch) | |
| tree | f7ef7f1985918402dbd4d4691899285a667fdcab /MediaBrowser.Controller | |
| parent | 84639948c75f1bf27bcff446450ad9137ecd8370 (diff) | |
| parent | 3bdaf640ec52e38e64da25fce07631034538c74a (diff) | |
Merge pull request #10981 from barronpm/livetv-listingsmanager
Add IListingsManager Service
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/IListingsManager.cs | 79 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/ILiveTvManager.cs | 31 | ||||
| -rw-r--r-- | MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs | 17 |
3 files changed, 79 insertions, 48 deletions
diff --git a/MediaBrowser.Controller/LiveTv/IListingsManager.cs b/MediaBrowser.Controller/LiveTv/IListingsManager.cs new file mode 100644 index 000000000..bbf569575 --- /dev/null +++ b/MediaBrowser.Controller/LiveTv/IListingsManager.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using MediaBrowser.Model.Dto; +using MediaBrowser.Model.LiveTv; + +namespace MediaBrowser.Controller.LiveTv; + +/// <summary> +/// Service responsible for managing <see cref="IListingsProvider"/>s and mapping +/// their channels to channels provided by <see cref="ITunerHost"/>s. +/// </summary> +public interface IListingsManager +{ + /// <summary> + /// Saves the listing provider. + /// </summary> + /// <param name="info">The listing provider information.</param> + /// <param name="validateLogin">A value indicating whether to validate login.</param> + /// <param name="validateListings">A value indicating whether to validate listings..</param> + /// <returns>Task.</returns> + Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings); + + /// <summary> + /// Deletes the listing provider. + /// </summary> + /// <param name="id">The listing provider's id.</param> + void DeleteListingsProvider(string? id); + + /// <summary> + /// Gets the lineups. + /// </summary> + /// <param name="providerType">Type of the provider.</param> + /// <param name="providerId">The provider identifier.</param> + /// <param name="country">The country.</param> + /// <param name="location">The location.</param> + /// <returns>The available lineups.</returns> + Task<List<NameIdPair>> GetLineups(string? providerType, string? providerId, string? country, string? location); + + /// <summary> + /// Gets the programs for a provided channel. + /// </summary> + /// <param name="channel">The channel to retrieve programs for.</param> + /// <param name="startDateUtc">The earliest date to retrieve programs for.</param> + /// <param name="endDateUtc">The latest date to retrieve programs for.</param> + /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param> + /// <returns>The available programs.</returns> + Task<IEnumerable<ProgramInfo>> GetProgramsAsync( + ChannelInfo channel, + DateTime startDateUtc, + DateTime endDateUtc, + CancellationToken cancellationToken); + + /// <summary> + /// Adds metadata from the <see cref="IListingsProvider"/>s to the provided channels. + /// </summary> + /// <param name="channels">The channels.</param> + /// <param name="enableCache">A value indicating whether to use the EPG channel cache.</param> + /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param> + /// <returns>A task representing the metadata population.</returns> + Task AddProviderMetadata(IList<ChannelInfo> channels, bool enableCache, CancellationToken cancellationToken); + + /// <summary> + /// Gets the channel mapping options for a provider. + /// </summary> + /// <param name="providerId">The id of the provider to use.</param> + /// <returns>The channel mapping options.</returns> + Task<ChannelMappingOptionsDto> GetChannelMappingOptions(string? providerId); + + /// <summary> + /// Sets the channel mapping. + /// </summary> + /// <param name="providerId">The id of the provider for the mapping.</param> + /// <param name="tunerChannelNumber">The tuner channel number.</param> + /// <param name="providerChannelNumber">The provider channel number.</param> + /// <returns>The updated channel mapping.</returns> + Task<TunerChannelMapping> SetChannelMapping(string providerId, string tunerChannelNumber, string providerChannelNumber); +} diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs index 7da455b8d..0ac0699a3 100644 --- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs +++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs @@ -36,8 +36,6 @@ namespace MediaBrowser.Controller.LiveTv /// <value>The services.</value> IReadOnlyList<ILiveTvService> Services { get; } - IReadOnlyList<IListingsProvider> ListingProviders { get; } - /// <summary> /// Gets the new timer defaults asynchronous. /// </summary> @@ -240,31 +238,6 @@ namespace MediaBrowser.Controller.LiveTv Task AddInfoToProgramDto(IReadOnlyCollection<(BaseItem Item, BaseItemDto ItemDto)> programs, IReadOnlyList<ItemFields> fields, User user = null); /// <summary> - /// Saves the listing provider. - /// </summary> - /// <param name="info">The information.</param> - /// <param name="validateLogin">if set to <c>true</c> [validate login].</param> - /// <param name="validateListings">if set to <c>true</c> [validate listings].</param> - /// <returns>Task.</returns> - Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings); - - void DeleteListingsProvider(string id); - - Task<TunerChannelMapping> SetChannelMapping(string providerId, string tunerChannelNumber, string providerChannelNumber); - - TunerChannelMapping GetTunerChannelMapping(ChannelInfo tunerChannel, NameValuePair[] mappings, List<ChannelInfo> providerChannels); - - /// <summary> - /// Gets the lineups. - /// </summary> - /// <param name="providerType">Type of the provider.</param> - /// <param name="providerId">The provider identifier.</param> - /// <param name="country">The country.</param> - /// <param name="location">The location.</param> - /// <returns>Task<List<NameIdPair>>.</returns> - Task<List<NameIdPair>> GetLineups(string providerType, string providerId, string country, string location); - - /// <summary> /// Adds the channel information. /// </summary> /// <param name="items">The items.</param> @@ -272,10 +245,6 @@ namespace MediaBrowser.Controller.LiveTv /// <param name="user">The user.</param> void AddChannelInfo(IReadOnlyCollection<(BaseItemDto ItemDto, LiveTvChannel Channel)> items, DtoOptions options, User user); - Task<List<ChannelInfo>> GetChannelsForListingsProvider(string id, CancellationToken cancellationToken); - - Task<List<ChannelInfo>> GetChannelsFromListingsProviderData(string id, CancellationToken cancellationToken); - string GetEmbyTvActiveRecordingPath(string id); ActiveRecordingInfo GetActiveRecordingInfo(string path); diff --git a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs b/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs deleted file mode 100644 index 1c1a4417d..000000000 --- a/MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs +++ /dev/null @@ -1,17 +0,0 @@ -#nullable disable - -#pragma warning disable CS1591 - -namespace MediaBrowser.Controller.LiveTv -{ - public class TunerChannelMapping - { - public string Name { get; set; } - - public string ProviderChannelName { get; set; } - - public string ProviderChannelId { get; set; } - - public string Id { get; set; } - } -} |
