EpisodeWidget: Do not display size if it's 0 bytes.

This commit is contained in:
Jordan Petridis
2017-12-23 15:44:28 +02:00
parent 37dbfff766
commit 2d6f02c407
3 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ pub(crate) fn new_episode(item: &Item, parent_id: i32) -> Result<NewEpisode> {
let pub_date = date.map(|x| x.to_rfc2822()).ok();
let epoch = date.map(|x| x.timestamp() as i32).unwrap_or(0);
let length = item.enclosure().map(|x| x.length().parse().unwrap_or(0));
let length = || -> Option<i32> { item.enclosure().map(|x| x.length().parse().ok())? }();
let duration = parse_itunes_duration(item);
Ok(NewEpisodeBuilder::default()