MusicVideo.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using MediaBrowser.Model.Entities;
  2. using System;
  3. using System.Runtime.Serialization;
  4. namespace MediaBrowser.Controller.Entities
  5. {
  6. public class MusicVideo : Video
  7. {
  8. /// <summary>
  9. /// Gets or sets the artist.
  10. /// </summary>
  11. /// <value>The artist.</value>
  12. public string Artist { get; set; }
  13. /// <summary>
  14. /// Gets or sets the album.
  15. /// </summary>
  16. /// <value>The album.</value>
  17. public string Album { get; set; }
  18. /// <summary>
  19. /// Should be overridden to return the proper folder where metadata lives
  20. /// </summary>
  21. /// <value>The meta location.</value>
  22. [IgnoreDataMember]
  23. public override string MetaLocation
  24. {
  25. get
  26. {
  27. return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart ? System.IO.Path.GetDirectoryName(Path) : Path;
  28. }
  29. }
  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. /// <summary>
  48. /// Needed because the resolver stops at the movie folder and we find the video inside.
  49. /// </summary>
  50. /// <value><c>true</c> if [use parent path to create resolve args]; otherwise, <c>false</c>.</value>
  51. protected override bool UseParentPathToCreateResolveArgs
  52. {
  53. get
  54. {
  55. return VideoType == VideoType.VideoFile || VideoType == VideoType.Iso || IsMultiPart;
  56. }
  57. }
  58. }
  59. }