35G7GDLMIDF24XXF7RP5FV6BPCMDC2MZMCBLWNF7DHJFTEHOQ66QC
let mut to_download = vec![];
if 0 < subscription_limit {
for ep in episodes.iter().rev().take(subscription_limit as usize) {
if let Some(episode) = Download::new(&state, &podcast, &ep).await? {
to_download.push(episode)
}
stream::iter(download_futures)
.filter_map(|download| async move { download.await.ok() })
.filter_map(|d| async move { d })
.collect::<Vec<Download>>()
.await
} else {
for ep in episodes.iter() {
if let Some(episode) = Download::new(&state, &podcast, &ep).await? {
to_download.push(episode)
}
None => {
let download_futures = episodes
.iter()
.map(|ep| Download::new(&state, &podcast, &ep));
stream::iter(download_futures)
.filter_map(|download| async move { download.await.ok() })
.filter_map(|d| async move { d })
.collect::<Vec<Download>>()
.await