I've written a script, gnupod_alter.pl, to make changes to the
gnutunesdb.xml file. If anyone wants to use it, it's available at
http://github.com/ChickenProp/gnupod-patches under the 'alter' branch.

I freely admit that the interface is pretty horrible. On the command line
you specify an attribute to filter based on, and more attributes to edit.
Then on stdin you pass the values for each of these attributes. It's
optimised for taking output from dumpsongs[1], passed through unix filters.
Which I guess is useful if you want to rot13 all your track names or
something, but not so much for anything that I've actually wanted to do. At
some point I'll probably start to allow something like
`gnupod_alter.plid=123 album=foo artist=bar`. (Which currently would
be written `echo
123\tfoo\tbar | gnupod_alter.pl id album artist`, and would set the album
and artist of track 123.) Or feel free to do it yourself and send a pull
request.

The other thing you can do is update the music file on the ipod with one on
disk, by using the nonattribute 'file'. I intend to add a nonattribute
'file-from-dir' which attempts to find the right track in a directory. Other
things which I might add include a way to copy metadata from a file on disk
(and possibly also update the file itself), and a way to add/remove tracks
from playlists.

Obviously, use at your own risk. I've tried to avoid data loss as much as
possible, by not making any changes until the very end and bailing if
anything goes wrong before then. (Except that I don't yet check whether the
file you're trying to update from exists. I assume that if it doesn't,
nothing gets deleted, but that's down to File::Copy. I recommend not trying
to update from files that don't exist.) If you want to see what's going to
happen (or if you have a backup gnutunesdb.xml but no mounted ipod), you can
tell it to work on a file other than the default with the -f option. In that
case it won't update any files, even if the ipod is mounted, but it will say
that it's updating them.

[1] gnupod_dumpsongs.pl is another script I wrote, also available in the
above github project under the branch 'dumpsongs'. It does basically the
same thing as gnupod_find.pl.
_______________________________________________
Bug-gnupod mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnupod

Reply via email to