Series.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 Series()
  16. {
  17. AirDays = new List<DayOfWeek>();
  18. }
  19. /// <summary>
  20. /// Gets or sets the status.
  21. /// </summary>
  22. /// <value>The status.</value>
  23. public SeriesStatus? Status { get; set; }
  24. /// <summary>
  25. /// Gets or sets the air days.
  26. /// </summary>
  27. /// <value>The air days.</value>
  28. public List<DayOfWeek> AirDays { get; set; }
  29. /// <summary>
  30. /// Gets or sets the air time.
  31. /// </summary>
  32. /// <value>The air time.</value>
  33. public string AirTime { get; set; }
  34. /// <summary>
  35. /// Series aren't included directly in indices - Their Episodes will roll up to them
  36. /// </summary>
  37. /// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
  38. [IgnoreDataMember]
  39. public override bool IncludeInIndex
  40. {
  41. get
  42. {
  43. return false;
  44. }
  45. }
  46. /// <summary>
  47. /// Gets the user data key.
  48. /// </summary>
  49. /// <returns>System.String.</returns>
  50. public override string GetUserDataKey()
  51. {
  52. return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey();
  53. }
  54. // Studio, Genre and Rating will all be the same so makes no sense to index by these
  55. protected override Dictionary<string, Func<User, IEnumerable<BaseItem>>> GetIndexByOptions()
  56. {
  57. return new Dictionary<string, Func<User, IEnumerable<BaseItem>>> {
  58. {LocalizedStrings.Instance.GetString("NoneDispPref"), null},
  59. {LocalizedStrings.Instance.GetString("PerformerDispPref"), GetIndexByPerformer},
  60. {LocalizedStrings.Instance.GetString("DirectorDispPref"), GetIndexByDirector},
  61. {LocalizedStrings.Instance.GetString("YearDispPref"), GetIndexByYear},
  62. };
  63. }
  64. /// <summary>
  65. /// Creates ResolveArgs on demand
  66. /// </summary>
  67. /// <param name="pathInfo">The path info.</param>
  68. /// <returns>ItemResolveArgs.</returns>
  69. protected internal override ItemResolveArgs CreateResolveArgs(FileSystemInfo pathInfo = null)
  70. {
  71. var args = base.CreateResolveArgs(pathInfo);
  72. Season.AddMetadataFiles(args);
  73. return args;
  74. }
  75. }
  76. }