Exemplo n.º 1
0
 /// <summary>
 /// TvdbDownloader constructor
 /// </summary>
 /// <param name="_apiKey"></param>
 internal TvdbDownloader(String _apiKey)
 {
     m_apiKey = _apiKey;
       m_webClient = new WebClient();//initialise webclient for downloading xml files
       m_webClient.Encoding = Encoding.UTF8;
       m_xmlHandler = new TvdbXmlReader();//xml handler (extract xml information into objects)
 }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor for XmlCacheProvider
 /// </summary>
 /// <param name="_rootFolder">This is the folder on the disk where all the information are stored</param>
 public XmlCacheProvider(String _rootFolder)
 {
     m_xmlWriter = new TvdbXmlWriter();
       m_xmlReader = new TvdbXmlReader();
       m_rootFolder = _rootFolder;
       if (!Directory.Exists(_rootFolder))
       {
     Directory.CreateDirectory(_rootFolder);
       }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Download available languages
 /// </summary>
 /// <returns></returns>
 internal List<TvdbLanguage> DownloadLanguages()
 {
     TvdbXmlReader hand = new TvdbXmlReader();
       String xml = m_webClient.DownloadString(TvdbLinks.CreateLanguageLink(m_apiKey));
       return hand.ExtractLanguages(xml);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <returns></returns>
 public bool UpdateTvdbMirrors()
 {
     WebClient client = new WebClient();
       String xml = client.DownloadString(TvdbLinks.BASE_SERVER + "api/" +
                                  "E8D8A47528D5B5AD" +
                                  TvdbLinks.MIRROR_PATH);
       TvdbXmlReader hand = new TvdbXmlReader();
       List<TvdbMirror> list = hand.ExtractMirrors(xml);
       if (list != null && list.Count > 0)
       {
     m_mirrorInfo = list;
     return true;
       }
       else
       {
     return false;
       }
 }
Exemplo n.º 5
0
 public XmlCacheProvider(String _rootFolder)
 {
     m_xmlWriter = new TvdbXmlWriter();
       m_xmlReader = new TvdbXmlReader();
       m_rootFolder = _rootFolder;
 }