private void SeriesWorkerDoWork( object sender, DoWorkEventArgs e ) { try { Factory.Instance.LogLines.Enqueue( @"Fetching TVDB metadata for " + this._seriesName + "..." ); var tvdbwoker = new TvdbWorker( this._seriesName ); tvdbwoker.Run(); Thread.Sleep( 50 ); while ( tvdbwoker.is_working() ) { Thread.Sleep( 1000 ); } this._series.Add( tvdbwoker.get_series() ); } catch ( Exception ex ) { Factory.Instance.LogLines.Enqueue( ex.Message ); Factory.Instance.LogLines.Enqueue( ex.StackTrace ); } }
private void AllSeriesWorkerDoWork( object sender, DoWorkEventArgs e ) { try { Factory.Instance.LogLines.Enqueue( @"Fetching TVDB metadata..." ); var wait = true; foreach ( var inode in this._dirs ) { if ( this._stop ) { break; } this.wait_limit_workers( 5, wait ); var tvdbwoker = new TvdbWorker( inode ); this._workers.Add( tvdbwoker ); wait = !tvdbwoker.is_cached(); tvdbwoker.Run(); var percent = ( this._workers.Count/( double ) this._dirs.Length )*10000.0; this._allSeriesWorker.ReportProgress( ( int ) percent ); } this.wait_for_workers(); if ( this._stop ) { return; } this.get_series_from_workers(); } catch ( Exception ex ) { Factory.Instance.LogLines.Enqueue( ex.Message ); Factory.Instance.LogLines.Enqueue( ex.StackTrace ); } }