Hello everybody,

The attached patch will delete episodes off the device (iPod or fs-based 
player) while syncing if they have been marked as played in gPodder. There 
are a bunch of things I moved around and hopefully I can summarize all the 
changes here:

- New config items: 
        'mp3_player_delete_played' and 'mp3_player_max_filename_length'

The first one enables the aforementioned new feature and I added the second 
option because I needed access to that variable from gui.py. Also, I think 
it's useful to make it easy for users to be able to adjust that setting. If 
mp3_player_max_filename_length is set to 0 the filename will not be 
truncated.

- New libpodcasts.podcastItem function: 'is_deleted()'

Just a handy function that checks if the file has been downloaded and if it is 
still on the disk, if not it returns True.

- Moved Leonid Ponomarev's OS encoding detection code to util.py

The same chunk of code was being used in util.py and sync.py so I moved it to 
it's own function in util.py. This makes things a bit neater.

- Remove filename sanitizing code from sync.py and move it to 
sanitize_filename in sync.py. Also make sanitize_filename capable of 
truncating filenames.

This makes getting file and folder names for filesystem based players a lot 
nicer. There were essentially three copies of the same code so I merged them 
into one function.

- New functions in gui.py: 
        'get_all_episodes(exclude_nonsignificant)' and 
'ipod_delete_played(device)'

The first function gets a list of all the episodes gPodder knows about except 
for non-downloaded episodes and episodes in channels that are set to skip 
when snycing. If you specify exclude_nonsignificant=True it will get every 
episode regardless of it's status. The second function is what actually 
deletes files off the mp3 player that have been marked as played in gPodder.

- New config option in gPodder Preferences window: 
        'Delete episodes on device that have been marked played in gPodder'

Since this setting depends on a setting and has other settings that conflict 
with it, I thought it would be a good idea to include it in the Preferences 
window. You'll see what I mean when you try it :)

Any comments/fixes would be greatly appreciated,

nick

P.S. Thanks to Shane Donohoe for coming up with the idea and helping me test 
it. (oddly enough, I really don't have much use for this feature :P)

Attachment: gPodder-r715-mp3-player-delete-played.patch.gz
Description: GNU Zip compressed data

_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel

Reply via email to