VideoFileInfo.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using MediaBrowser.Model.Entities;
  2. namespace Emby.Naming.Video
  3. {
  4. /// <summary>
  5. /// Represents a single video file.
  6. /// </summary>
  7. public class VideoFileInfo
  8. {
  9. /// <summary>
  10. /// Gets or sets the path.
  11. /// </summary>
  12. /// <value>The path.</value>
  13. public string Path { get; set; }
  14. /// <summary>
  15. /// Gets or sets the container.
  16. /// </summary>
  17. /// <value>The container.</value>
  18. public string Container { get; set; }
  19. /// <summary>
  20. /// Gets or sets the name.
  21. /// </summary>
  22. /// <value>The name.</value>
  23. public string Name { get; set; }
  24. /// <summary>
  25. /// Gets or sets the year.
  26. /// </summary>
  27. /// <value>The year.</value>
  28. public int? Year { get; set; }
  29. /// <summary>
  30. /// Gets or sets the type of the extra, e.g. trailer, theme song, behind the scenes, etc.
  31. /// </summary>
  32. /// <value>The type of the extra.</value>
  33. public ExtraType? ExtraType { get; set; }
  34. /// <summary>
  35. /// Gets or sets the extra rule.
  36. /// </summary>
  37. /// <value>The extra rule.</value>
  38. public ExtraRule ExtraRule { get; set; }
  39. /// <summary>
  40. /// Gets or sets the format3 d.
  41. /// </summary>
  42. /// <value>The format3 d.</value>
  43. public string Format3D { get; set; }
  44. /// <summary>
  45. /// Gets or sets a value indicating whether [is3 d].
  46. /// </summary>
  47. /// <value><c>true</c> if [is3 d]; otherwise, <c>false</c>.</value>
  48. public bool Is3D { get; set; }
  49. /// <summary>
  50. /// Gets or sets a value indicating whether this instance is stub.
  51. /// </summary>
  52. /// <value><c>true</c> if this instance is stub; otherwise, <c>false</c>.</value>
  53. public bool IsStub { get; set; }
  54. /// <summary>
  55. /// Gets or sets the type of the stub.
  56. /// </summary>
  57. /// <value>The type of the stub.</value>
  58. public string StubType { get; set; }
  59. /// <summary>
  60. /// Gets or sets a value indicating whether this instance is a directory.
  61. /// </summary>
  62. /// <value>The type.</value>
  63. public bool IsDirectory { get; set; }
  64. /// <summary>
  65. /// Gets the file name without extension.
  66. /// </summary>
  67. /// <value>The file name without extension.</value>
  68. public string FileNameWithoutExtension => !IsDirectory
  69. ? System.IO.Path.GetFileNameWithoutExtension(Path)
  70. : System.IO.Path.GetFileName(Path);
  71. /// <inheritdoc />
  72. public override string ToString()
  73. {
  74. // Makes debugging easier
  75. return Name ?? base.ToString();
  76. }
  77. }
  78. }