示例#1
0
        private void TvdbHandlerOnUpdateFinished(TvdbHandler.UpdateFinishedEventArgs args)
        {
            FireCacheUpdateFinished(args.UpdateStarted, args.UpdateFinished, UpdateType.Series, args.UpdatedSeries.Select(i => i.ToString()).ToList());
            FireCacheUpdateFinished(args.UpdateStarted, args.UpdateFinished, UpdateType.Episode, args.UpdatedEpisodes.Select(i => i.ToString()).ToList());

            ServiceRegistration.Get <ILogger>().Debug("TvDbWrapper: Finished updating cache from {0} to {1}", args.UpdateStarted, args.UpdateFinished);
            ServiceRegistration.Get <ILogger>().Debug("TvDbWrapper: Updated {0} Series, {1} Episodes, {2} Banners.", args.UpdatedSeries.Count, args.UpdatedEpisodes.Count, args.UpdatedBanners.Count);
        }
示例#2
0
        void UpdateFormFinishedThreadSafe(TvdbHandler.UpdateFinishedEventArgs _event)
        {
            if (!InvokeRequired)
            {
                try
                {
                    cmdAbortUpdate.Enabled = false;

                    StringBuilder b = new StringBuilder();
                    b.AppendLine("Update finished in " + (_event.UpdateFinished - _event.UpdateStarted).TotalSeconds + " seconds");
                    b.AppendLine("Updated the following (" + _event.UpdatedSeries.Count + ") series");
                    b.AppendLine("==============================");
                    foreach (int s in _event.UpdatedSeries)
                    {
                        b.AppendLine(s.ToString());
                    }
                    b.AppendLine("");
                    b.AppendLine("Updated the following (" + _event.UpdatedEpisodes.Count + ") episodes");
                    b.AppendLine("==============================");
                    foreach (int e in _event.UpdatedEpisodes)
                    {
                        b.AppendLine(e.ToString());
                    }

                    txtUpdateProgress.Text = b.ToString();
                    cmdApply.Enabled       = true;
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
            else
            {
                Invoke(new UpdateFormFinishedThreadSafeDelegate(UpdateFormFinishedThreadSafe), new object[] { _event });
            }
        }
示例#3
0
 private void TvdbHandlerOnUpdateFinished(TvdbHandler.UpdateFinishedEventArgs args)
 {
     ServiceRegistration.Get <ILogger>().Debug("TvDbWrapper: Finished updating cache from {0} to {1}", args.UpdateStarted, args.UpdateFinished);
     ServiceRegistration.Get <ILogger>().Debug("TvDbWrapper: Updated {0} Series, {1} Episodes, {2} Banners.", args.UpdatedSeries.Count, args.UpdatedEpisodes.Count, args.UpdatedBanners.Count);
 }
示例#4
0
 void m_tvdbHandler_UpdateFinished(TvdbHandler.UpdateFinishedEventArgs _event)
 {
     UpdateFormFinishedThreadSafe(_event);
 }
示例#5
0
 void m_tvdbHandler_UpdateFinished(TvdbHandler.UpdateFinishedEventArgs _event)
 {
     UpdateFormFinishedThreadSafe(_event);
     //throw new NotImplementedException();
 }