2012-07-07 23:52:04 +00:00
|
|
|
|
using System;
|
|
|
|
|
using NLog;
|
2012-07-10 04:37:24 +00:00
|
|
|
|
using NzbDrone.Common;
|
2013-02-24 06:48:52 +00:00
|
|
|
|
using NzbDrone.Core.Configuration;
|
2013-03-01 07:03:41 +00:00
|
|
|
|
using NzbDrone.Core.MediaFiles;
|
2013-02-19 06:01:03 +00:00
|
|
|
|
using NzbDrone.Core.Tv;
|
2012-07-07 23:52:04 +00:00
|
|
|
|
using NzbDrone.Core.Model;
|
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
using NzbDrone.Core.Repository;
|
2012-10-17 00:08:47 +00:00
|
|
|
|
using TvdbLib.Data;
|
2012-07-07 23:52:04 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.Metadata
|
|
|
|
|
{
|
|
|
|
|
public abstract class MetadataBase
|
|
|
|
|
{
|
|
|
|
|
protected readonly Logger _logger;
|
2013-02-24 06:48:52 +00:00
|
|
|
|
protected readonly IConfigService _configService;
|
2012-07-10 04:37:24 +00:00
|
|
|
|
protected readonly DiskProvider _diskProvider;
|
|
|
|
|
protected readonly BannerProvider _bannerProvider;
|
2013-02-22 00:47:09 +00:00
|
|
|
|
protected readonly IEpisodeService _episodeService;
|
2012-07-07 23:52:04 +00:00
|
|
|
|
|
2013-02-24 06:48:52 +00:00
|
|
|
|
protected MetadataBase(IConfigService configService, DiskProvider diskProvider,
|
2013-02-22 00:47:09 +00:00
|
|
|
|
BannerProvider bannerProvider, IEpisodeService episodeService)
|
2012-07-07 23:52:04 +00:00
|
|
|
|
{
|
2013-02-24 06:48:52 +00:00
|
|
|
|
_configService = configService;
|
2012-07-10 04:37:24 +00:00
|
|
|
|
_diskProvider = diskProvider;
|
|
|
|
|
_bannerProvider = bannerProvider;
|
2013-02-20 02:05:15 +00:00
|
|
|
|
_episodeService = episodeService;
|
2012-07-07 23:52:04 +00:00
|
|
|
|
_logger = LogManager.GetLogger(GetType().ToString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 04:37:24 +00:00
|
|
|
|
/// Gets the name for the metabase provider
|
2012-07-07 23:52:04 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract string Name { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 04:37:24 +00:00
|
|
|
|
/// Creates metadata for a series
|
2012-07-07 23:52:04 +00:00
|
|
|
|
/// </summary>
|
2012-07-10 04:37:24 +00:00
|
|
|
|
/// <param name = "series">The series to create the metadata for</param>
|
|
|
|
|
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
|
2012-07-12 21:08:21 +00:00
|
|
|
|
public abstract void CreateForSeries(Series series, TvdbSeries tvDbSeries);
|
2012-07-07 23:52:04 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
2012-07-10 04:37:24 +00:00
|
|
|
|
/// Creates metadata for the episode file
|
2012-07-07 23:52:04 +00:00
|
|
|
|
/// </summary>
|
2012-07-10 04:37:24 +00:00
|
|
|
|
/// <param name = "episodeFile">The episode file to create the metadata</param>
|
|
|
|
|
/// <param name = "tvDbSeries">Series information from TheTvDb</param>
|
2012-07-12 21:08:21 +00:00
|
|
|
|
public abstract void CreateForEpisodeFile(EpisodeFile episodeFile, TvdbSeries tvDbSeries);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removes metadata for a series
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name = "series">The series to create the metadata for</param>
|
|
|
|
|
public abstract void RemoveForSeries(Series series);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Removes metadata for the episode file
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name = "episodeFile">The episode file to create the metadata</param>
|
|
|
|
|
public abstract void RemoveForEpisodeFile(EpisodeFile episodeFile);
|
2012-07-07 23:52:04 +00:00
|
|
|
|
|
2012-07-10 04:37:24 +00:00
|
|
|
|
public virtual string GetEpisodeGuideUrl(int seriesId)
|
|
|
|
|
{
|
|
|
|
|
return String.Format("http://www.thetvdb.com/api/{0}/series/{1}/all/en.zip", TvDbProvider.TVDB_APIKEY, seriesId);
|
|
|
|
|
}
|
2012-07-07 23:52:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|