예제 #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 MainForm()
        {
            InitializeComponent();

            _seriesFolder = _settings.AppConfiguration.SeriesFolder;
            _tvdb         = new TvDbWrapper(_settings.AppConfiguration.ApiKey);
        }
예제 #3
0
 public override async Task <bool> InitWrapperAsync(bool useHttps)
 {
     try
     {
         TvDbWrapper wrapper = new TvDbWrapper(NAME);
         // Try to lookup online content in the configured language
         CultureInfo mpLocal = new CultureInfo(PreferredLanguageCulture);
         if (await wrapper.InitAsync(CACHE_PATH, useHttps).ConfigureAwait(false))
         {
             _wrapper = wrapper;
             wrapper.SetPreferredLanguageAsync(mpLocal.TwoLetterISOLanguageName).Wait();
             return(true);
         }
     }
     catch (Exception ex)
     {
         ServiceRegistration.Get <ILogger>().Error("SeriesTvDbMatcher: Error initializing wrapper", ex);
     }
     return(false);
 }