Series.cs 2.7 KB

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