fix #648 Checking for new episodes clears file_size for some downloaded files

in particular youtube episode info never has file size, erasing downloaded file size.
Thanks to @auouymous for the fix
This commit is contained in:
Eric Le Lay 2019-08-11 12:05:28 +02:00
parent a7385c95b5
commit d004d952f5
1 changed files with 6 additions and 2 deletions

View File

@ -766,8 +766,12 @@ class PodcastEpisode(PodcastModelObject):
return '-'
def update_from(self, episode):
for k in ('title', 'url', 'description', 'description_html', 'link', 'published', 'guid', 'file_size', 'payment_url'):
setattr(self, k, getattr(episode, k))
for k in ('title', 'url', 'description', 'description_html', 'link', 'published', 'guid', 'payment_url'):
setattr(self, k, getattr(episode, k))
# Don't overwrite file size on downloaded episodes
# See #648 refreshing a youtube podcast clears downloaded file size
if self.state != gpodder.STATE_DOWNLOADED:
setattr(self, 'file_size', getattr(episode, 'file_size'))
class PodcastChannel(PodcastModelObject):