From b9f505ba2b766f9baa4989653f936ad9fd35ae2c Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Tue, 17 Aug 2010 03:07:05 +0200 Subject: [PATCH] Fallback to stored total time if missing If the total time of an episode action received from the local player application is zero, use the total time stored in the episode metadata, as it is a better approximation than what we got from the player (zero in that case). --- src/gpodder/gui.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gpodder/gui.py b/src/gpodder/gui.py index e8841e97..db3d971d 100644 --- a/src/gpodder/gui.py +++ b/src/gpodder/gui.py @@ -595,6 +595,9 @@ class gPodder(BuilderWidget, dbus.service.Object): now = time.time() if total > 0: episode.total_time = total + elif total == 0: + # Assume the episode's total time for the action + total = episode.total_time if episode.current_position_updated is None or \ now > episode.current_position_updated: episode.current_position = end -- 2.11.4.GIT