using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
namespace MediaBrowser.Controller.Providers
{
public class ItemLookupInfo : IHasProviderIds
{
///
/// Gets or sets the name.
///
/// The name.
public string Name { get; set; }
///
/// Gets or sets the metadata language.
///
/// The metadata language.
public string MetadataLanguage { get; set; }
///
/// Gets or sets the metadata country code.
///
/// The metadata country code.
public string MetadataCountryCode { get; set; }
///
/// Gets or sets the provider ids.
///
/// The provider ids.
public Dictionary ProviderIds { get; set; }
///
/// Gets or sets the year.
///
/// The year.
public int? Year { get; set; }
public int? IndexNumber { get; set; }
public int? ParentIndexNumber { get; set; }
public ItemLookupInfo()
{
ProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
}
public interface IHasLookupInfo
where TLookupInfoType : ItemLookupInfo, new()
{
TLookupInfoType GetLookupInfo();
}
public class ArtistInfo : ItemLookupInfo
{
public List SongInfos { get; set; }
public ArtistInfo()
{
SongInfos = new List();
}
}
public class AlbumInfo : ItemLookupInfo
{
///
/// Gets or sets the album artist.
///
/// The album artist.
public string AlbumArtist { get; set; }
///
/// Gets or sets the artist provider ids.
///
/// The artist provider ids.
public Dictionary ArtistProviderIds { get; set; }
public List SongInfos { get; set; }
public AlbumInfo()
{
ArtistProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase);
SongInfos = new List();
}
}
public class GameInfo : ItemLookupInfo
{
///
/// Gets or sets the game system.
///
/// The game system.
public string GameSystem { get; set; }
}
public class GameSystemInfo : ItemLookupInfo
{
///
/// Gets or sets the path.
///
/// The path.
public string Path { get; set; }
}
public class EpisodeInfo : ItemLookupInfo, IHasIdentities
{
private List _identities = new List();
public Dictionary SeriesProviderIds { get; set; }
public int? IndexNumberEnd { get; set; }
public int? AnimeSeriesIndex { get; set; }
public EpisodeInfo()
{
SeriesProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
public IEnumerable Identities
{
get { return _identities; }
}
public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
{
var identifier = new ItemIdentifier();
_identities = (await identifier.FindIdentities(this, providerManager, cancellationToken)).ToList();
}
}
public class EpisodeIdentity : IItemIdentity
{
public string Type { get; set; }
public string SeriesId { get; set; }
public int? SeasonIndex { get; set; }
public int IndexNumber { get; set; }
public int? IndexNumberEnd { get; set; }
}
public class SongInfo : ItemLookupInfo
{
public string AlbumArtist { get; set; }
public string Album { get; set; }
public List Artists { get; set; }
}
public class SeriesInfo : ItemLookupInfo, IHasIdentities
{
private List _identities = new List();
public int? AnimeSeriesIndex { get; set; }
public IEnumerable Identities
{
get { return _identities; }
}
public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
{
var identifier = new ItemIdentifier();
_identities = (await identifier.FindIdentities(this, providerManager, cancellationToken)).ToList();
}
}
public class SeriesIdentity : IItemIdentity
{
public string Type { get; set; }
public string Id { get; set; }
}
public class PersonLookupInfo : ItemLookupInfo
{
}
public class MovieInfo : ItemLookupInfo
{
}
public class BoxSetInfo : ItemLookupInfo
{
}
public class MusicVideoInfo : ItemLookupInfo
{
}
public class TrailerInfo : ItemLookupInfo
{
public bool IsLocalTrailer { get; set; }
}
public class BookInfo : ItemLookupInfo
{
public string SeriesName { get; set; }
}
public class SeasonInfo : ItemLookupInfo, IHasIdentities
{
private List _identities = new List();
public Dictionary SeriesProviderIds { get; set; }
public int? AnimeSeriesIndex { get; set; }
public SeasonInfo()
{
SeriesProviderIds = new Dictionary(StringComparer.OrdinalIgnoreCase);
}
public IEnumerable Identities
{
get { return _identities; }
}
public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
{
var identifier = new ItemIdentifier();
_identities = (await identifier.FindIdentities(this, providerManager, cancellationToken)).ToList();
}
}
public class SeasonIdentity : IItemIdentity
{
public string Type { get; set; }
public string SeriesId { get; set; }
public int SeasonIndex { get; set; }
}
}