ExternalIds.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #pragma warning disable CS1591
  2. using MediaBrowser.Controller.Entities.Audio;
  3. using MediaBrowser.Controller.Providers;
  4. using MediaBrowser.Model.Entities;
  5. using MediaBrowser.Model.Providers;
  6. namespace MediaBrowser.Providers.Plugins.AudioDb
  7. {
  8. public class AudioDbAlbumExternalId : IExternalId
  9. {
  10. /// <inheritdoc />
  11. public string ProviderName => "TheAudioDb";
  12. /// <inheritdoc />
  13. public string Key => MetadataProvider.AudioDbAlbum.ToString();
  14. /// <inheritdoc />
  15. public ExternalIdMediaType? Type => null;
  16. /// <inheritdoc />
  17. public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
  18. /// <inheritdoc />
  19. public bool Supports(IHasProviderIds item) => item is MusicAlbum;
  20. }
  21. public class AudioDbOtherAlbumExternalId : IExternalId
  22. {
  23. /// <inheritdoc />
  24. public string ProviderName => "TheAudioDb";
  25. /// <inheritdoc />
  26. public string Key => MetadataProvider.AudioDbAlbum.ToString();
  27. /// <inheritdoc />
  28. public ExternalIdMediaType? Type => ExternalIdMediaType.Album;
  29. /// <inheritdoc />
  30. public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
  31. /// <inheritdoc />
  32. public bool Supports(IHasProviderIds item) => item is Audio;
  33. }
  34. public class AudioDbArtistExternalId : IExternalId
  35. {
  36. /// <inheritdoc />
  37. public string ProviderName => "TheAudioDb";
  38. /// <inheritdoc />
  39. public string Key => MetadataProvider.AudioDbArtist.ToString();
  40. /// <inheritdoc />
  41. public ExternalIdMediaType? Type => ExternalIdMediaType.Artist;
  42. /// <inheritdoc />
  43. public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
  44. /// <inheritdoc />
  45. public bool Supports(IHasProviderIds item) => item is MusicArtist;
  46. }
  47. public class AudioDbOtherArtistExternalId : IExternalId
  48. {
  49. /// <inheritdoc />
  50. public string ProviderName => "TheAudioDb";
  51. /// <inheritdoc />
  52. public string Key => MetadataProvider.AudioDbArtist.ToString();
  53. /// <inheritdoc />
  54. public ExternalIdMediaType? Type => ExternalIdMediaType.OtherArtist;
  55. /// <inheritdoc />
  56. public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
  57. /// <inheritdoc />
  58. public bool Supports(IHasProviderIds item) => item is Audio || item is MusicAlbum;
  59. }
  60. }