[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gnupod] Append artist to title in iTunesDB
From: |
H. Langos |
Subject: |
Re: [Bug-gnupod] Append artist to title in iTunesDB |
Date: |
Mon, 25 May 2009 15:20:00 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hi Richard,
There are (hopefully) not that many braindead devices out there. At least
they are probably not all braindead in the same way. :-)
Currently I think it should not be in the code base.
This may change if more people report the same problem.
cheers
-henrik
On Thu, May 21, 2009 at 09:13:54PM +0200, Richard van den Berg wrote:
> Since my car iPod adapter is brain dead and only displays the title of
> songs, I've patched gnupod to append the artist to the title in the
> iTunesDB. It's stripped again by tunes2pod.pl so the GNUtunesDB.xml
> stays clean.
>
> If this is a feature that could be useful to others, let me know and
> I'll make it optional using a switch to mktunes.pl and tunes2pod.pl
>
> Cheers,
>
> Richard
> ? .gnupod_version
> ? Makefile
> ? autom4te.cache
> ? config.log
> ? config.status
> ? configure
> Index: src/ext/Mktunes.pm
> ===================================================================
> RCS file: /sources/gnupod/gnupod/src/ext/Mktunes.pm,v
> retrieving revision 1.6
> diff -u -r1.6 Mktunes.pm
> --- src/ext/Mktunes.pm 6 Oct 2007 07:26:52 -0000 1.6
> +++ src/ext/Mktunes.pm 21 May 2009 19:09:50 -0000
> @@ -275,7 +275,7 @@
> foreach my $key (sort keys(%$object)) {
> my $value = $object->{$key};
> next unless $value; # Do not write empty values
> - my $new_mhod = GNUpod::iTunesDB::mk_mhod({stype=>$key,
> string=>$value});
> + my $new_mhod = GNUpod::iTunesDB::mk_mhod({stype=>$key,
> string=>($key eq "title"?$value." | ".$object->{artist}:$value)});
> next unless $new_mhod; # Something went wrong
> $mhod_chunks .= $new_mhod;
> $mhod_count++;
> Index: src/ext/iTunesDB.pm
> ===================================================================
> RCS file: /sources/gnupod/gnupod/src/ext/iTunesDB.pm,v
> retrieving revision 1.113
> diff -u -r1.113 iTunesDB.pm
> --- src/ext/iTunesDB.pm 12 May 2009 10:36:52 -0000 1.113
> +++ src/ext/iTunesDB.pm 21 May 2009 19:09:51 -0000
> @@ -1208,7 +1208,12 @@
> $r{string_size} = get_int($seek+28,4,$fd);
> my $tmpstring =
> get_string($seek+($r{total_size}-$r{string_size}), $r{string_size}, $fd);
> $tmpstring = Unicode::String::byteswap2($tmpstring);
> + if($r{type} == 1) {
> + # Title mhod, strip added artist
> + $r{string} = shift(@{[split(/ \|
> /,Unicode::String::utf16($tmpstring)->utf8)]});
> + } else {
> $r{string} = Unicode::String::utf16($tmpstring)->utf8;
> + }
> }
> return \%r;
> }
> _______________________________________________
> Bug-gnupod mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/bug-gnupod