jellyfin/MediaBrowser.Controller/Entities/TV/Series.cs

105 lines
3.5 KiB
C#
Raw Normal View History

2013-05-15 06:57:13 -07:00
using MediaBrowser.Controller.Library;
2013-02-20 18:33:05 -07:00
using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
2013-05-15 06:57:13 -07:00
using System.IO;
2013-02-20 18:33:05 -07:00
using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities.TV
{
/// <summary>
/// Class Series
/// </summary>
2013-12-02 09:46:25 -07:00
public class Series : Folder, IHasSoundtracks, IHasTrailers
2013-02-20 18:33:05 -07:00
{
public List<Guid> SpecialFeatureIds { get; set; }
2013-11-12 08:36:08 -07:00
public List<Guid> SoundtrackIds { get; set; }
public int SeasonCount { get; set; }
2013-05-15 06:57:13 -07:00
public Series()
{
AirDays = new List<DayOfWeek>();
SpecialFeatureIds = new List<Guid>();
2013-11-12 08:36:08 -07:00
SoundtrackIds = new List<Guid>();
2013-12-02 09:46:25 -07:00
RemoteTrailers = new List<MediaUrl>();
LocalTrailerIds = new List<Guid>();
2013-05-15 06:57:13 -07:00
}
2013-12-02 09:46:25 -07:00
public List<Guid> LocalTrailerIds { get; set; }
public List<MediaUrl> RemoteTrailers { get; set; }
2013-02-20 18:33:05 -07:00
/// <summary>
/// Gets or sets the status.
/// </summary>
/// <value>The status.</value>
public SeriesStatus? Status { get; set; }
/// <summary>
/// Gets or sets the air days.
/// </summary>
/// <value>The air days.</value>
public List<DayOfWeek> AirDays { get; set; }
/// <summary>
/// Gets or sets the air time.
/// </summary>
/// <value>The air time.</value>
public string AirTime { get; set; }
2013-09-29 17:51:21 -07:00
/// <summary>
/// Gets or sets the date last episode added.
/// </summary>
/// <value>The date last episode added.</value>
public DateTime DateLastEpisodeAdded { get; set; }
2013-02-20 18:33:05 -07:00
/// <summary>
/// Series aren't included directly in indices - Their Episodes will roll up to them
/// </summary>
/// <value><c>true</c> if [include in index]; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public override bool IncludeInIndex
{
get
{
return false;
}
}
/// <summary>
/// Gets the user data key.
2013-02-20 18:33:05 -07:00
/// </summary>
/// <returns>System.String.</returns>
public override string GetUserDataKey()
2013-02-20 18:33:05 -07:00
{
return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey();
2013-02-20 18:33:05 -07:00
}
// Studio, Genre and Rating will all be the same so makes no sense to index by these
protected override Dictionary<string, Func<User, IEnumerable<BaseItem>>> GetIndexByOptions()
{
return new Dictionary<string, Func<User, IEnumerable<BaseItem>>> {
{LocalizedStrings.Instance.GetString("NoneDispPref"), null},
{LocalizedStrings.Instance.GetString("PerformerDispPref"), GetIndexByPerformer},
{LocalizedStrings.Instance.GetString("DirectorDispPref"), GetIndexByDirector},
{LocalizedStrings.Instance.GetString("YearDispPref"), GetIndexByYear},
};
}
/// <summary>
/// Creates ResolveArgs on demand
/// </summary>
/// <param name="pathInfo">The path info.</param>
/// <returns>ItemResolveArgs.</returns>
protected internal override ItemResolveArgs CreateResolveArgs(FileSystemInfo pathInfo = null)
2013-02-20 18:33:05 -07:00
{
var args = base.CreateResolveArgs(pathInfo);
Season.AddMetadataFiles(args);
return args;
}
}
}