IListingsManager.cs 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Model.Dto;
  6. using MediaBrowser.Model.LiveTv;
  7. namespace MediaBrowser.Controller.LiveTv;
  8. /// <summary>
  9. /// Service responsible for managing <see cref="IListingsProvider"/>s and mapping
  10. /// their channels to channels provided by <see cref="ITunerHost"/>s.
  11. /// </summary>
  12. public interface IListingsManager
  13. {
  14. /// <summary>
  15. /// Saves the listing provider.
  16. /// </summary>
  17. /// <param name="info">The listing provider information.</param>
  18. /// <param name="validateLogin">A value indicating whether to validate login.</param>
  19. /// <param name="validateListings">A value indicating whether to validate listings..</param>
  20. /// <returns>Task.</returns>
  21. Task<ListingsProviderInfo> SaveListingProvider(ListingsProviderInfo info, bool validateLogin, bool validateListings);
  22. /// <summary>
  23. /// Deletes the listing provider.
  24. /// </summary>
  25. /// <param name="id">The listing provider's id.</param>
  26. void DeleteListingsProvider(string? id);
  27. /// <summary>
  28. /// Gets the lineups.
  29. /// </summary>
  30. /// <param name="providerType">Type of the provider.</param>
  31. /// <param name="providerId">The provider identifier.</param>
  32. /// <param name="country">The country.</param>
  33. /// <param name="location">The location.</param>
  34. /// <returns>The available lineups.</returns>
  35. Task<List<NameIdPair>> GetLineups(string? providerType, string? providerId, string? country, string? location);
  36. /// <summary>
  37. /// Gets the programs for a provided channel.
  38. /// </summary>
  39. /// <param name="channel">The channel to retrieve programs for.</param>
  40. /// <param name="startDateUtc">The earliest date to retrieve programs for.</param>
  41. /// <param name="endDateUtc">The latest date to retrieve programs for.</param>
  42. /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
  43. /// <returns>The available programs.</returns>
  44. Task<IEnumerable<ProgramInfo>> GetProgramsAsync(
  45. ChannelInfo channel,
  46. DateTime startDateUtc,
  47. DateTime endDateUtc,
  48. CancellationToken cancellationToken);
  49. /// <summary>
  50. /// Adds metadata from the <see cref="IListingsProvider"/>s to the provided channels.
  51. /// </summary>
  52. /// <param name="channels">The channels.</param>
  53. /// <param name="enableCache">A value indicating whether to use the EPG channel cache.</param>
  54. /// <param name="cancellationToken">The <see cref="CancellationToken"/> to use.</param>
  55. /// <returns>A task representing the metadata population.</returns>
  56. Task AddProviderMetadata(IList<ChannelInfo> channels, bool enableCache, CancellationToken cancellationToken);
  57. /// <summary>
  58. /// Gets the channel mapping options for a provider.
  59. /// </summary>
  60. /// <param name="providerId">The id of the provider to use.</param>
  61. /// <returns>The channel mapping options.</returns>
  62. Task<ChannelMappingOptionsDto> GetChannelMappingOptions(string? providerId);
  63. /// <summary>
  64. /// Sets the channel mapping.
  65. /// </summary>
  66. /// <param name="providerId">The id of the provider for the mapping.</param>
  67. /// <param name="tunerChannelNumber">The tuner channel number.</param>
  68. /// <param name="providerChannelNumber">The provider channel number.</param>
  69. /// <returns>The updated channel mapping.</returns>
  70. Task<TunerChannelMapping> SetChannelMapping(string providerId, string tunerChannelNumber, string providerChannelNumber);
  71. }