Skip to content

Commit

Permalink
Merge pull request #101 from pluton8/bug1832_device_sync_progress
Browse files Browse the repository at this point in the history
Gtk UI: Fix device sync progress not updating (bug 1832)
  • Loading branch information
thp committed Jun 18, 2013
2 parents 1c3c6f1 + 7dc92bf commit 22efa71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/gpodder/gtkui/desktop/sync.py
Expand Up @@ -203,7 +203,8 @@ def resume_sync(episode_urls, channel_urls,progress):
# Finally start the synchronization process
@util.run_in_background
def sync_thread_func():
device.add_sync_tasks(episodes, force_played=force_played)
device.add_sync_tasks(episodes, force_played=force_played,
done_callback=self.enable_download_list_update)

return

Expand Down
5 changes: 4 additions & 1 deletion src/gpodder/sync.py
Expand Up @@ -202,7 +202,7 @@ def close(self):
logger.warning('Not syncing disks. Unmount your device before unplugging.')
return True

def add_sync_tasks(self,tracklist, force_played=False):
def add_sync_tasks(self,tracklist, force_played=False, done_callback=None):
for track in list(tracklist):
# Filter tracks that are not meant to be synchronized
does_not_exist = not track.was_downloaded(and_exists=True)
Expand All @@ -229,6 +229,9 @@ def add_sync_tasks(self,tracklist, force_played=False):
else:
logger.warning("No episodes to sync")

if done_callback:
done_callback()

return True

def remove_tracks(self, tracklist):
Expand Down

0 comments on commit 22efa71

Please sign in to comment.