Пример #1
0
        protected override bool Init()
        {
            if (!base.Init())
            {
                return(false);
            }

            if (_tv != null)
            {
                return(true);
            }
            try
            {
                TvDbWrapper tv = new TvDbWrapper();
                // Try to lookup online content in the configured language
                CultureInfo currentCulture = ServiceRegistration.Get <ILocalization>().CurrentCulture;
                tv.SetPreferredLanguage(currentCulture.TwoLetterISOLanguageName);
                bool res = tv.Init();
                _tv = tv;
                return(res);
            }
            catch (Libraries.TvdbLib.Exceptions.TvdbNotAvailableException)
            {
                return(false);
            }
        }
Пример #2
0
 public override bool InitWrapper(bool useHttps)
 {
     try
     {
         TvDbWrapper wrapper = new TvDbWrapper();
         // Try to lookup online content in the configured language
         CultureInfo mpLocal = new CultureInfo(PreferredLanguageCulture);
         if (wrapper.Init(CACHE_PATH, useHttps))
         {
             _wrapper = wrapper;
             wrapper.SetPreferredLanguage(mpLocal.TwoLetterISOLanguageName);
             return(true);
         }
     }
     catch (Exception ex)
     {
         ServiceRegistration.Get <ILogger>().Error("SeriesTvDbMatcher: Error initializing wrapper", ex);
     }
     return(false);
 }