using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace MediaBrowser.Controller.Entities.TV
{
///
/// Class Series
///
public class Series : Folder
{
///
/// 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; }
///
/// 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;
}
}
///
/// Override to use the provider Ids so it will be portable
///
/// The user data id.
[IgnoreDataMember]
public override Guid UserDataId
{
get
{
if (_userDataId == Guid.Empty)
{
var baseId = this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Tvcom);
_userDataId = baseId != null ? baseId.GetMD5() : Id;
}
return _userDataId;
}
}
// Studio, Genre and Rating will all be the same so makes no sense to index by these
protected override Dictionary>> GetIndexByOptions()
{
return new Dictionary>> {
{LocalizedStrings.Instance.GetString("NoneDispPref"), null},
{LocalizedStrings.Instance.GetString("PerformerDispPref"), GetIndexByPerformer},
{LocalizedStrings.Instance.GetString("DirectorDispPref"), GetIndexByDirector},
{LocalizedStrings.Instance.GetString("YearDispPref"), GetIndexByYear},
};
}
///
/// Creates ResolveArgs on demand
///
/// The path info.
/// ItemResolveArgs.
protected internal override ItemResolveArgs CreateResolveArgs(WIN32_FIND_DATA? pathInfo = null)
{
var args = base.CreateResolveArgs(pathInfo);
Season.AddMetadataFiles(args);
return args;
}
}
}