MusicVideo.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using MediaBrowser.Controller.Entities.Audio;
  2. using MediaBrowser.Controller.Providers;
  3. using MediaBrowser.Model.Configuration;
  4. using MediaBrowser.Model.Entities;
  5. using System;
  6. namespace MediaBrowser.Controller.Entities
  7. {
  8. public class MusicVideo : Video, IHasArtist, IHasMusicGenres, IHasBudget, IHasLookupInfo<MusicVideoInfo>
  9. {
  10. /// <summary>
  11. /// Gets or sets the artist.
  12. /// </summary>
  13. /// <value>The artist.</value>
  14. public string Artist { get; set; }
  15. /// <summary>
  16. /// Gets or sets the album.
  17. /// </summary>
  18. /// <value>The album.</value>
  19. public string Album { get; set; }
  20. /// <summary>
  21. /// Gets or sets the budget.
  22. /// </summary>
  23. /// <value>The budget.</value>
  24. public double? Budget { get; set; }
  25. /// <summary>
  26. /// Gets or sets the revenue.
  27. /// </summary>
  28. /// <value>The revenue.</value>
  29. public double? Revenue { get; set; }
  30. /// <summary>
  31. /// Determines whether the specified name has artist.
  32. /// </summary>
  33. /// <param name="name">The name.</param>
  34. /// <returns><c>true</c> if the specified name has artist; otherwise, <c>false</c>.</returns>
  35. public bool HasArtist(string name)
  36. {
  37. return string.Equals(Artist, name, StringComparison.OrdinalIgnoreCase);
  38. }
  39. /// <summary>
  40. /// Gets the user data key.
  41. /// </summary>
  42. /// <returns>System.String.</returns>
  43. public override string GetUserDataKey()
  44. {
  45. return this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? base.GetUserDataKey();
  46. }
  47. protected override bool GetBlockUnratedValue(UserConfiguration config)
  48. {
  49. return config.BlockUnratedMusic;
  50. }
  51. public MusicVideoInfo GetLookupInfo()
  52. {
  53. return GetItemLookupInfo<MusicVideoInfo>();
  54. }
  55. }
  56. }