public void DownloadTvDBEpisode(TvDB_EpisodeVM episode, bool forceDownload) { if (string.IsNullOrEmpty(episode.Filename)) return; try { string url = string.Format(Constants.URLS.TvDB_Images, episode.Filename); string filename = episode.FullImagePath; ImageDownloadRequest req = new ImageDownloadRequest(ImageEntityType.TvDB_Episode, episode, forceDownload); // check if this file has already been downloaded and exists if (!req.ForceDownload) { // check to make sure the file actually exists if (!File.Exists(episode.FullImagePath)) { this.imagesToDownload.Add(req); OnQueueUpdateEvent(new QueueUpdateEventArgs(this.QueueCount)); return; } // the file exists so don't download it again return; } this.imagesToDownload.Add(req); OnQueueUpdateEvent(new QueueUpdateEventArgs(this.QueueCount)); } catch (Exception ex) { Utils.ShowErrorMessage(ex); } }
void cboEpisodeNumber_SelectionChanged(object sender, SelectionChangedEventArgs e) { SelectedEpisode = cboEpisodeNumber.SelectedItem as TvDB_EpisodeVM; }