示例#1
0
        private void GetThread(object codeIn)
        {
            System.Diagnostics.Debug.Assert(workerSemaphore != null);

            try
            {
                workerSemaphore.WaitOne(); // don't start until we're allowed to

                SeriesSpecifier series = (SeriesSpecifier)(codeIn);

                bool bannersToo = TVSettings.Instance.NeedToDownloadBannerFile();

                Threadslogger.Trace("  Downloading " + series.SeriesId);
                bool r = TheTVDB.Instance.EnsureUpdated(series.SeriesId, bannersToo, series.UseCustomLanguage, series.CustomLanguageCode);
                Threadslogger.Trace("  Finished " + series.SeriesId);
                if (!r)
                {
                    downloadOk = false;
                    if (downloadStopOnError)
                    {
                        DownloadDone = true;
                    }
                }

                workerSemaphore.Release(1);
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "Unhandled Exception in GetThread");
            }
        }
示例#2
0
        private void GetThread(object codeIn)
        {
            System.Diagnostics.Debug.Assert(workerSemaphore != null);

            SeriesSpecifier series = (SeriesSpecifier)(codeIn);

            try
            {
                workerSemaphore.WaitOne(); // don't start until we're allowed to

                bool bannersToo = TVSettings.Instance.NeedToDownloadBannerFile();

                Threadslogger.Trace("  Downloading " + series.Name);

                if (TheTVDB.Instance.EnsureUpdated(series, bannersToo))
                {
                    return;
                }

                downloadOk = false;
                if (downloadStopOnError)
                {
                    DownloadDone = true;
                }
            }
            catch (ShowNotFoundException snfe)
            {
                problematicSeriesIds.Add(snfe.ShowId);
            }
            catch (Exception e)
            {
                Logger.Fatal(e, $"Unhandled Exception in GetThread for {series.Name} id={series.SeriesId} and lang={series.CustomLanguageCode}");
            }
            finally
            {
                Threadslogger.Trace("  Finished " + series.SeriesId);
                workerSemaphore.Release(1);
            }
        }
示例#3
0
 public abstract bool EnsureUpdated(SeriesSpecifier s, bool bannersToo, bool showErrorMsgBox);