Пример #1
0
        /// <summary>
        /// Handles the DoWork event of the bgwScan control.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.
        /// </param>
        private void BgwScan_DoWork(object sender, DoWorkEventArgs e)
        {
            var tvdb  = new TheTvdb();
            int count = 0;

            foreach (UpdateTvRecords record in this.updateDatabase)
            {
                InternalApps.Logs.Log.WriteToLog(
                    LogSeverity.Debug,
                    0,
                    "UI > Dialogs > TV > FrmUpdateShows > BgwScan_DoWork",
                    string.Format(
                        "Checking {0} {1}x{2:00} for update",
                        record.SeriesName, record.SeasonNumber.GetValueOrDefault(0), record.EpisodeNumber.GetValueOrDefault(0)
                        )
                    );

                this.bgwScan.ReportProgress(0, record);

                Series seriesObj = TvDBFactory.GetSeriesFromName(record.SeriesName);

                Series newSeries = tvdb.CheckForUpdate(seriesObj.SeriesID, seriesObj.Language, seriesObj.Lastupdated);

                if (newSeries != null)
                {
                    InternalApps.Logs.Log.WriteToLog(
                        LogSeverity.Debug,
                        0,
                        "UI > Dialogs > TV > FrmUpdateShows > BgwScan_DoWork",
                        string.Format(
                            "Update found for {0} {1}x{2:00}",
                            record.SeriesName, record.SeasonNumber.GetValueOrDefault(0), record.EpisodeNumber.GetValueOrDefault(0)
                            )
                        );

                    record.NewTime = newSeries.Lastupdated;
                    count++;
                }
            }

            e.Result = count;
        }
Пример #2
0
        /// <summary>
        /// Handles the DoWork event of the bgwScan control.
        /// </summary>
        /// <param name="sender">
        /// The source of the event.
        /// </param>
        /// <param name="e">
        /// The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.
        /// </param>
        private void BgwScan_DoWork(object sender, DoWorkEventArgs e)
        {
            var tvdb  = new TheTvdb();
            int count = 0;

            foreach (UpdateTvRecords series in this.updateDatabase)
            {
                this.bgwScan.ReportProgress(0, series.SeriesName);

                Series seriesObj = TvDBFactory.GetSeriesFromName(series.SeriesName);

                Series newSeries = tvdb.CheckForUpdate(seriesObj.SeriesID, seriesObj.Language, seriesObj.Lastupdated);

                if (newSeries != null)
                {
                    series.NewTime = newSeries.Lastupdated;
                    count++;
                }
            }

            e.Result = count;
        }