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:
parent
a7385c95b5
commit
d004d952f5
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue