internal static void QueuePodcastDownload(PodcastInfo pi) { if (pi == null || pi.DownloadInfo != null) { return; } DownloadInfo dif; if (pi.CanDownload) { try { dif = GetDownloadInfo(pi); pi.DownloadInfo = dif; pi.DownloadFailed = false; } catch { pi.DownloadFailed = true; return; } lock (downloads.SyncRoot) { downloads.Add(dif, pi); } DownloadCore.QueueDownload(dif); } }
internal static void QueuePodcastDownload(ICollection podcasts) { DownloadInfo tmp_dif; ArrayList podcast_difs = new ArrayList(); if (podcasts == null) { return; } lock (downloads.SyncRoot) { foreach (PodcastInfo pi in podcasts) { if (pi == null || pi.DownloadInfo != null) { continue; } try { if (pi.CanDownload) { tmp_dif = GetDownloadInfo(pi); pi.DownloadInfo = tmp_dif; pi.DownloadFailed = false; podcast_difs.Add(tmp_dif); downloads.Add(tmp_dif, pi); } } catch { pi.DownloadFailed = true; continue; } } } if (podcast_difs.Count == 1) { DownloadCore.QueueDownload(podcast_difs [0] as DownloadInfo); } else if (podcast_difs.Count > 0) { DownloadCore.QueueDownload(podcast_difs); } }