Media RSS: Get filesize and duration (bug 1446)

This commit is contained in:
Thomas Perl 2011-11-12 14:57:40 +01:00
parent 85ea863c94
commit 1b0dc1a709
1 changed files with 6 additions and 1 deletions

View File

@ -272,10 +272,15 @@ class PodcastEpisode(PodcastModelObject):
continue
try:
episode.file_size = int(m.fileSize) or -1
episode.file_size = int(m.get('filesize', 0)) or -1
except:
episode.file_size = -1
try:
episode.total_time = int(m.get('duration', 0)) or 0
except:
episode.total_time = 0
return episode
# Brute-force detection of any links