MusicVideo.cs 2.0 KB

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