gPodder Bug Tracker – Bug 107
Support for Offline mode
Last modified: 2012-10-23 11:42:36 BST
gPodder should support offline mode that prevents feed updates and downloads from happening. On the Desktop version, this can be hooked up to NetworkManager to get connectivity info (and make offline/online mode work automatically) and on Maemo, we have to find the correct way of identifying a connection.
We should also add support for users without NetworkManager and Maemo, i.e. a "manual offline" mode, so all users can use this feature and not be annoyed by it.
* Global boolean variable "offline" (True or False)
* Can always be set manually (via main menu item)
* If NM or Maemo is present, set it automatically when network status changes
* Identify network-dependent code parts and disable/inform user about impossible actions
* Set sensitivity of network-dependend actions (buttons, menu items, ...) to False when offline
I can't preselect episodes to download when not connected – I just get an error message. As a user, what I expect to happen is for the episode to be queued for download when next connected.
If the unit (e.g N800) is offline and I select download, I just get an error message. I expected to be able to preselect (mark) episodes to be downloaded later, when online becomes available. Can you just check the online status, and if
offline, just mark it for later download? Also, why does it take about 15secs to realise its not online – seems a bit daft when I can just look at the network icon in the corner and know that instantly.
So I suggest that if the nokia is set to offline mode then just queue the
download for later. In not, and the wifi is not connected, either
automatically connect or start the connect dialogue. That way I can go through all the available podcasts when away from a connection and preselect the podcasts to be downloaded when I get home. Ideally this list should be saved (not just to RAM), so if I close gpodder during the day, the list is not lost.
*** Bug 16 has been marked as a duplicate of this bug. ***
This is targetted for 0.16.x
Offline mode for feed updates is already supported (i.e. detecting if we are offline). Also, downloads time out after a while and can be restarted then (although not automatically). That's it for now. If somebody wants to improve this in the future, feel free to do so. The latest codebase has all the changes that make the initial reasons for the Offline mode less important.
Created attachment 726 [details]
Proposed patch from http://www.freelists.org/post/gpodder/checking-for-network-before-updating-podcasts (by Eric Le Lay)
Adding Eric (the patch author) CC.
Implemented now, feedback appreciated: http://gpodder.org/commit/e3f53600
(En réponse au commentaire 9)
> Implemented now, feedback appreciated: http://gpodder.org/commit/e3f53600
fine, but can we get rid of the annoying popup on automatic refresh when offline is detected ?
By the way, something along
"""Get active network interfaces using 'ifconfig'
Returns a list of active network interfaces or an
empty list if the device is offline. The loopback
interface is not included.
stdout = subprocess.check_output(['ifconfig'])
itfs = re.split('\n(?!\t)',stdout,re.MULTILINE)
active = 
for i in itfs:
b=re.match('(\\w+):.*status: active$', i, re.MULTILINE | re.DOTALL)
if b is not None:
should do the trick for OSX online detection
(In reply to comment #10)
> (En réponse au commentaire 9)
> > Implemented now, feedback appreciated: http://gpodder.org/commit/e3f53600
> fine, but can we get rid of the annoying popup on automatic refresh when
> offline is detected ?
I intended to do that, but on second look, I forgot the "return" after the line "logger.debug('Skipping auto update (no connection available)')". Fixed now, thanks for the feedback:
> def osx_get_active_interfaces():
> """Get active network interfaces using 'ifconfig'
> Returns a list of active network interfaces or an
> empty list if the device is offline. The loopback
> interface is not included.
> stdout = subprocess.check_output(['ifconfig'])
> itfs = re.split('\n(?!\t)',stdout,re.MULTILINE)
> active = 
> for i in itfs:
> b=re.match('(\\w+):.*status: active$', i, re.MULTILINE | re.DOTALL)
> if b is not None:
> return active
I'll gladly merge this - have you tested this? If not, can you test it and tell me that it works? I'll add it in then :)
(En réponse au commentaire 11)
> I'll gladly merge this - have you tested this? If not, can you test it and tell
> me that it works? I'll add it in then :)
Yes, I tested on OSX 10.6.8.
(In reply to comment #12)
> (En réponse au commentaire 11)
> > I'll gladly merge this - have you tested this? If not, can you test it and tell
> > me that it works? I'll add it in then :)
> Yes, I tested on OSX 10.6.8.
Thanks, I've merged a slighty modified version of your patch, please test to see if I didn't mess anything up: