diff --git a/hammond-data/src/models/new_podcast.rs b/hammond-data/src/models/new_podcast.rs index e888340..a4faa2a 100644 --- a/hammond-data/src/models/new_podcast.rs +++ b/hammond-data/src/models/new_podcast.rs @@ -91,14 +91,13 @@ impl NewPodcast { let description = ammonia::clean(chan.description().trim()); let link = url_cleaner(chan.link()); + + // Try to get the itunes img first let itunes_img = chan.itunes_ext() .and_then(|s| s.image()) .map(|s| s.to_owned()); - let image_uri = if itunes_img.is_some() { - itunes_img - } else { - chan.image().map(|s| s.url().to_owned()) - }; + // If itunes is None, try to get the channel.image from the rss spec + let image_uri = itunes_img.or_else(|| chan.image().map(|s| s.url().to_owned())); NewPodcastBuilder::default() .title(title)