using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities.TV
{
///
/// Class Series
///
public class Series : Folder, IHasSoundtracks, IHasTrailers, IHasTags
{
public List SpecialFeatureIds { get; set; }
public List SoundtrackIds { get; set; }
public int SeasonCount { get; set; }
public Series()
{
AirDays = new List();
SpecialFeatureIds = new List();
SoundtrackIds = new List();
RemoteTrailers = new List();
LocalTrailerIds = new List();
Tags = new List();
DisplaySpecialsWithSeasons = true;
}
public bool DisplaySpecialsWithSeasons { get; set; }
public List LocalTrailerIds { get; set; }
public List RemoteTrailers { get; set; }
///
/// Gets or sets the tags.
///
/// The tags.
public List Tags { get; set; }
///
/// Gets or sets the status.
///
/// The status.
public SeriesStatus? Status { get; set; }
///
/// Gets or sets the air days.
///
/// The air days.
public List AirDays { get; set; }
///
/// Gets or sets the air time.
///
/// The air time.
public string AirTime { get; set; }
///
/// Gets or sets the date last episode added.
///
/// The date last episode added.
public DateTime DateLastEpisodeAdded { get; set; }
///
/// Series aren't included directly in indices - Their Episodes will roll up to them
///
/// true if [include in index]; otherwise, false.
[IgnoreDataMember]
public override bool IncludeInIndex
{
get
{
return false;
}
}
///
/// Gets the user data key.
///
/// System.String.
public override string GetUserDataKey()
{
return this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom) ?? base.GetUserDataKey();
}
// Studio, Genre and Rating will all be the same so makes no sense to index by these
protected override IEnumerable GetIndexByOptions()
{
return new List {
{LocalizedStrings.Instance.GetString("NoneDispPref")},
{LocalizedStrings.Instance.GetString("PerformerDispPref")},
{LocalizedStrings.Instance.GetString("DirectorDispPref")},
{LocalizedStrings.Instance.GetString("YearDispPref")},
};
}
///
/// Creates ResolveArgs on demand
///
/// The path info.
/// ItemResolveArgs.
protected internal override ItemResolveArgs CreateResolveArgs(FileSystemInfo pathInfo = null)
{
var args = base.CreateResolveArgs(pathInfo);
Season.AddMetadataFiles(args);
return args;
}
[IgnoreDataMember]
public bool ContainsEpisodesWithoutSeasonFolders
{
get
{
return Children.OfType