aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/ItemLookupInfo.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Providers/ItemLookupInfo.cs')
-rw-r--r--MediaBrowser.Controller/Providers/ItemLookupInfo.cs76
1 files changed, 72 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs
index 65ee94556..20bc572b4 100644
--- a/MediaBrowser.Controller/Providers/ItemLookupInfo.cs
+++ b/MediaBrowser.Controller/Providers/ItemLookupInfo.cs
@@ -1,4 +1,7 @@
-using MediaBrowser.Model.Entities;
+using System.Linq;
+using System.Threading;
+using System.Threading.Tasks;
+using MediaBrowser.Model.Entities;
using System;
using System.Collections.Generic;
@@ -96,8 +99,10 @@ namespace MediaBrowser.Controller.Providers
public string Path { get; set; }
}
- public class EpisodeInfo : ItemLookupInfo
+ public class EpisodeInfo : ItemLookupInfo, IHasIdentities<EpisodeIdentity>
{
+ private List<EpisodeIdentity> _identities = new List<EpisodeIdentity>();
+
public Dictionary<string, string> SeriesProviderIds { get; set; }
public int? IndexNumberEnd { get; set; }
@@ -107,6 +112,27 @@ namespace MediaBrowser.Controller.Providers
{
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
+
+ public IEnumerable<EpisodeIdentity> Identities
+ {
+ get { return _identities; }
+ }
+
+ public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
+ {
+ var identifier = new ItemIdentifier<EpisodeInfo, EpisodeIdentity>();
+ _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
@@ -116,9 +142,29 @@ namespace MediaBrowser.Controller.Providers
public List<string> Artists { get; set; }
}
- public class SeriesInfo : ItemLookupInfo
+ public class SeriesInfo : ItemLookupInfo, IHasIdentities<SeriesIdentity>
{
+ private List<SeriesIdentity> _identities = new List<SeriesIdentity>();
+
public int? AnimeSeriesIndex { get; set; }
+
+ public IEnumerable<SeriesIdentity> Identities
+ {
+ get { return _identities; }
+ }
+
+ public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
+ {
+ var identifier = new ItemIdentifier<SeriesInfo, SeriesIdentity>();
+ _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
@@ -151,8 +197,10 @@ namespace MediaBrowser.Controller.Providers
public string SeriesName { get; set; }
}
- public class SeasonInfo : ItemLookupInfo
+ public class SeasonInfo : ItemLookupInfo, IHasIdentities<SeasonIdentity>
{
+ private List<SeasonIdentity> _identities = new List<SeasonIdentity>();
+
public Dictionary<string, string> SeriesProviderIds { get; set; }
public int? AnimeSeriesIndex { get; set; }
@@ -160,5 +208,25 @@ namespace MediaBrowser.Controller.Providers
{
SeriesProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
+
+ public IEnumerable<SeasonIdentity> Identities
+ {
+ get { return _identities; }
+ }
+
+ public async Task FindIdentities(IProviderManager providerManager, CancellationToken cancellationToken)
+ {
+ var identifier = new ItemIdentifier<SeasonInfo, SeasonIdentity>();
+ _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; }
}
}