Hello, Shane!
On Mon, 2008-06-30 at 19:48 +0100, Shane Donohoe wrote:
> I tried using the cmd_all_downloads_complete option in the advanced
> configuration with a bash script I made myself. The script adds all
> new music files to the mpd playlist by doing a diff of the playlist
> before and after synching. However, the script does not work with the
> option. Sometimes the script does run, but not correctly and other
> times, I get a message saying the script can not be found. The script
> does perform the expected functionality when run manually.
Scripting - yay!
What is "mpc listall &>/tmp/mpd-old" supposed to do? Don't you mean "mpc
listall >/tmp/mpd-old"?
Instead of diff'ing mpd-old and mpd-new, you can use this simply python
script which will read all lines in both files, leaving only files that
are in new_files but not in old_files. It will then call "mpdadd" for
all files found.
==================
#!/usr/bin/python
import os
old_files = set(open('/tmp/mpd-old').readlines())
new_files = set(open('/tmp/mpd-new').readlines())
for filename in new_files.difference(old_files):
os.system('echo mpdadd "%s"' % filename.strip())
==================
This should make your script simpler and hopefully working with
gPodder :)
Good luck!
Thomas
_______________________________________________
gpodder-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-devel