2010-09-23 03:19:47 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using TvdbLib;
|
|
|
|
|
using TvdbLib.Cache;
|
|
|
|
|
using TvdbLib.Data;
|
|
|
|
|
|
2010-09-28 04:25:41 +00:00
|
|
|
|
namespace NzbDrone.Core.Providers
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
2010-09-28 04:25:41 +00:00
|
|
|
|
public class TvDbProvider : ITvDbProvider
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
|
|
|
|
private const string TvDbApiKey = "5D2D188E86E07F4F";
|
|
|
|
|
private readonly TvdbHandler _handler;
|
|
|
|
|
|
2010-09-28 04:25:41 +00:00
|
|
|
|
public TvDbProvider()
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
2010-09-24 07:24:05 +00:00
|
|
|
|
_handler = new TvdbHandler(new XmlCacheProvider(Path.Combine(Main.AppPath, @"cache\tvdbcache.xml")), TvDbApiKey);
|
2010-09-23 03:19:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
2010-09-28 04:25:41 +00:00
|
|
|
|
#region ITvDbProvider Members
|
2010-09-23 03:19:47 +00:00
|
|
|
|
|
2010-09-28 00:27:02 +00:00
|
|
|
|
public IList<TvdbSearchResult> SearchSeries(string name)
|
2010-09-23 03:19:47 +00:00
|
|
|
|
{
|
|
|
|
|
return _handler.SearchSeries(name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public TvdbSeries GetSeries(int id, TvdbLanguage language)
|
|
|
|
|
{
|
|
|
|
|
return _handler.GetSeries(id, language, true, false, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|