Series.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. using MediaBrowser.Controller.Library;
  2. using MediaBrowser.Controller.Localization;
  3. using MediaBrowser.Model.Entities;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Runtime.Serialization;
  8. namespace MediaBrowser.Controller.Entities.TV
  9. {
  10. /// <summary>
  11. /// Class Series
  12. /// </summary>
  13. public class Series : Folder
  14. {
  15. public List<Guid> SpecialFeatureIds { get; set; }
  16. public int SeasonCount { get; set; }
  17. public Series()
  18. {
  19. AirDays = new List<DayOfWeek>();
  20. SpecialFeatureIds = new List<Guid>();
  21. }
  22. /// <summary>
  23. /// Gets or sets the status.
  24. /// </summary>
  25. /// <value>The status.</value>
  26. public SeriesStatus? Status { get; set; }
  27. /// <summary>
  28. /// Gets or sets the air days.
  29. /// </summary>
  30. /// <value>The air days.</value>
  31. public List<DayOfWeek> AirDays { get; set; }
  32. /// <summary>
  33. /// Gets or sets the air time.
  34. /// </summary>
  35. /// <value>The air time.</value>
  36. public string AirTime { get; set; }
  37. /// <summary>
  38. /// Gets or sets the date last episode added.
  39. /// </summary>
  40. /// <value>The date last episode added.</value>
  41. public DateTime DateLastEpisodeAdded { get; set; }
  42. /// <summary>
  43. /// Series aren't included directly in indices - Their Episodes will roll up to them
  44. /// </summary>
  45. /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
  46. [IgnoreDataMember]
  47. public override bool IncludeInIndex
  48. {
  49. get
  50. {
  51. return false;
  52. }
  53. }
  54. /// <summary>
  55. /// Gets the user data key.
  56. /// </summary>
  57. /// <returns>System.String.</returns>
  58. public override string GetUserDataKey()
  59. {
  60. return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey();
  61. }
  62. // Studio, Genre and Rating will all be the same so makes no sense to index by these
  63. protected override Dictionary<string, Func<User, IEnumerable<BaseItem>>> GetIndexByOptions()
  64. {
  65. return new Dictionary<string, Func<User, IEnumerable<BaseItem>>> {
  66. {LocalizedStrings.Instance.GetString("NoneDispPref"), null},
  67. {LocalizedStrings.Instance.GetString("PerformerDispPref"), GetIndexByPerformer},
  68. {LocalizedStrings.Instance.GetString("DirectorDispPref"), GetIndexByDirector},
  69. {LocalizedStrings.Instance.GetString("YearDispPref"), GetIndexByYear},
  70. };
  71. }
  72. /// <summary>
  73. /// Creates ResolveArgs on demand
  74. /// </summary>
  75. /// <param name="pathInfo">The path info.</param>
  76. /// <returns>ItemResolveArgs.</returns>
  77. protected internal override ItemResolveArgs CreateResolveArgs(FileSystemInfo pathInfo = null)
  78. {
  79. var args = base.CreateResolveArgs(pathInfo);
  80. Season.AddMetadataFiles(args);
  81. return args;
  82. }
  83. }
  84. }