Series.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. /// Series aren't included directly in indices - Their Episodes will roll up to them
  39. /// </summary>
  40. /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
  41. [IgnoreDataMember]
  42. public override bool IncludeInIndex
  43. {
  44. get
  45. {
  46. return false;
  47. }
  48. }
  49. /// <summary>
  50. /// Gets the user data key.
  51. /// </summary>
  52. /// <returns>System.String.</returns>
  53. public override string GetUserDataKey()
  54. {
  55. return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey();
  56. }
  57. // Studio, Genre and Rating will all be the same so makes no sense to index by these
  58. protected override Dictionary<string, Func<User, IEnumerable<BaseItem>>> GetIndexByOptions()
  59. {
  60. return new Dictionary<string, Func<User, IEnumerable<BaseItem>>> {
  61. {LocalizedStrings.Instance.GetString("NoneDispPref"), null},
  62. {LocalizedStrings.Instance.GetString("PerformerDispPref"), GetIndexByPerformer},
  63. {LocalizedStrings.Instance.GetString("DirectorDispPref"), GetIndexByDirector},
  64. {LocalizedStrings.Instance.GetString("YearDispPref"), GetIndexByYear},
  65. };
  66. }
  67. /// <summary>
  68. /// Creates ResolveArgs on demand
  69. /// </summary>
  70. /// <param name="pathInfo">The path info.</param>
  71. /// <returns>ItemResolveArgs.</returns>
  72. protected internal override ItemResolveArgs CreateResolveArgs(FileSystemInfo pathInfo = null)
  73. {
  74. var args = base.CreateResolveArgs(pathInfo);
  75. Season.AddMetadataFiles(args);
  76. return args;
  77. }
  78. }
  79. }