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