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); } }
public MainForm() { InitializeComponent(); _seriesFolder = _settings.AppConfiguration.SeriesFolder; _tvdb = new TvDbWrapper(_settings.AppConfiguration.ApiKey); }
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); }