AudioDbExternalIds.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using MediaBrowser.Controller.Entities.Audio;
  2. using MediaBrowser.Controller.Providers;
  3. using MediaBrowser.Model.Entities;
  4. namespace MediaBrowser.Providers.Music
  5. {
  6. public class AudioDbAlbumExternalId : IExternalId
  7. {
  8. /// <inheritdoc />
  9. public string Name => "TheAudioDb";
  10. /// <inheritdoc />
  11. public string Key => MetadataProviders.AudioDbAlbum.ToString();
  12. /// <inheritdoc />
  13. public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
  14. /// <inheritdoc />
  15. public bool Supports(IHasProviderIds item)
  16. => item is MusicAlbum;
  17. }
  18. public class AudioDbOtherAlbumExternalId : IExternalId
  19. {
  20. /// <inheritdoc />
  21. public string Name => "TheAudioDb Album";
  22. /// <inheritdoc />
  23. public string Key => MetadataProviders.AudioDbAlbum.ToString();
  24. /// <inheritdoc />
  25. public string UrlFormatString => "https://www.theaudiodb.com/album/{0}";
  26. /// <inheritdoc />
  27. public bool Supports(IHasProviderIds item) => item is Audio;
  28. }
  29. public class AudioDbArtistExternalId : IExternalId
  30. {
  31. /// <inheritdoc />
  32. public string Name => "TheAudioDb";
  33. /// <inheritdoc />
  34. public string Key => MetadataProviders.AudioDbArtist.ToString();
  35. /// <inheritdoc />
  36. public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
  37. /// <inheritdoc />
  38. public bool Supports(IHasProviderIds item) => item is MusicArtist;
  39. }
  40. public class AudioDbOtherArtistExternalId : IExternalId
  41. {
  42. /// <inheritdoc />
  43. public string Name => "TheAudioDb Artist";
  44. /// <inheritdoc />
  45. public string Key => MetadataProviders.AudioDbArtist.ToString();
  46. /// <inheritdoc />
  47. public string UrlFormatString => "https://www.theaudiodb.com/artist/{0}";
  48. /// <inheritdoc />
  49. public bool Supports(IHasProviderIds item)
  50. => item is Audio || item is MusicAlbum;
  51. }
  52. }