Series.cs 2.7 KB

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