You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jellyfin/MediaBrowser.Providers/TV/TvdbSeasonIdentityProvider.cs

29 lines
957 B

using System.Threading.Tasks;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
namespace MediaBrowser.Providers.TV
{
public class TvdbSeasonIdentityProvider : IItemIdentityProvider<SeasonInfo, SeasonIdentity>
{
public Task<SeasonIdentity> FindIdentity(SeasonInfo info)
{
string tvdbSeriesId;
if (!info.SeriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out tvdbSeriesId) || string.IsNullOrEmpty(tvdbSeriesId) || info.IndexNumber == null)
{
return Task.FromResult<SeasonIdentity>(null);
}
var result = new SeasonIdentity
{
Type = MetadataProviders.Tvdb.ToString(),
SeriesId = tvdbSeriesId,
SeasonIndex = info.IndexNumber.Value
};
return Task.FromResult(result);
}
public int Order { get { return 0; } }
}
}