currently gnupod is somewhat broken with respect to compilations.  it
sets all files as being part of a compilation.  this is due to a
backward conversion in the mktunes/tunes2pod code.  i've changed this to
be the right way around.

i've also added support for a --set-compilation flag to gnupod_addsong
to add a compilation="1" tag to the xml.

i've done a little bit of testing and it seems to work for me.  see
attached.

cheers


Index: src/gnupod_addsong.pl
===================================================================
RCS file: /sources/gnupod/gnupod/src/gnupod_addsong.pl,v
retrieving revision 1.73
diff -u -r1.73 gnupod_addsong.pl
--- src/gnupod_addsong.pl	1 Sep 2007 19:13:01 -0000	1.73
+++ src/gnupod_addsong.pl	10 Sep 2007 07:46:29 -0000
@@ -46,7 +46,7 @@
                    "set-title=s", "set-artist=s", "set-album=s", "set-genre=s", "set-rating=i", "set-playcount=i",
                    "set-bookmarkable", "set-shuffleskip",
                    "set-songnum", "playlist|p=s@", "reencode|e=i",
-                   "min-vol-adj=i", "max-vol-adj=i", "playlist-is-podcast" );
+                   "min-vol-adj=i", "max-vol-adj=i", "playlist-is-podcast", "set-compilation");
 GNUpod::FooBar::GetConfig(\%opts, {'decode'=>'s', mount=>'s', duplicate=>'b',
                                    'disable-v1'=>'b', 'disable-v2'=>'b', 'set-songnum'=>'b',
                                    'min-vol-adj'=>'i', 'max-vol-adj'=>'i', 'automktunes'=>'b' },
@@ -172,6 +172,7 @@
 		$fh->{album}        = $opts{'set-album'}       if $opts{'set-album'};
 		$fh->{genre}        = $opts{'set-genre'}       if $opts{'set-genre'};
 		$fh->{rating}       = $opts{'set-rating'}      if $opts{'set-rating'};
+		$fh->{compilation}  = 1                        if defined($opts{'set-compilation'});
 		$fh->{bookmarkable} = 1                        if defined($opts{'set-bookmarkable'});
 		$fh->{shuffleskip}  = 1                        if defined($opts{'set-shuffleskip'});
 		$fh->{playcount}    = $opts{'set-playcount'}   if $opts{'set-playcount'};
@@ -541,6 +542,7 @@
        --set-songnum                Override 'Songnum/Tracknum' field
        --set-bookmarkable           Set this song as bookmarkable (= Remember position)
        --set-shuffleskip            Exclude this file in shuffle-mode
+       --set-compilation            Mark songs as being part of a compilation
        --min-vol-adj=int            Minimum volume adjustment allowed by ID3v2.4 RVA2 tag
        --max-vol-adj=int            Maximum ditto.  The volume can be adjusted in the range
                                     -100% to +100%.  The default for these two options is 0,
Index: src/ext/iTunesDB.pm
===================================================================
RCS file: /sources/gnupod/gnupod/src/ext/iTunesDB.pm,v
retrieving revision 1.88
diff -u -r1.88 iTunesDB.pm
--- src/ext/iTunesDB.pm	1 Sep 2007 19:13:02 -0000	1.88
+++ src/ext/iTunesDB.pm	10 Sep 2007 07:46:30 -0000
@@ -340,7 +340,7 @@
     $ret .= pack("V", _icl(1));                             #Visible?
     $ret .= pack("V");                                      #FileType. Should be 'MP3 '. (FIXME: Extension or type?)
     $ret .= pack("v", 0x100);                               #cbr = 100, vbr = 101, aac = 0x010 ##FIXME: COrrect?
-    $ret .= pack("c", (($file_hash{compilation})==0));      #compilation ?
+    $ret .= pack("c", (($file_hash{compilation})!=0));      #compilation
     $ret .= pack("c",$file_hash{rating});                   #rating
     $ret .= pack("V", _icl($file_hash{changetime}));        #Time changed
     $ret .= pack("V", _icl($file_hash{filesize}));          #filesize
@@ -1141,7 +1141,7 @@
 $ret{id}         = get_int($sum+16,4,$fd);
 #$ret{rating}     = int((get_int($sum+28,4)-256)/oct('0x14000000')) * 20;
 ##XXX 26-30 are useless for us..
-$ret{compilation}= (get_int($sum+30,1,$fd)==0);
+$ret{compilation}= (get_int($sum+30,1,$fd)!=0);
 $ret{rating}     = get_int($sum+31,1,$fd);
 $ret{changetime} = get_int($sum+32,4,$fd);
 $ret{filesize}   = get_int($sum+36,4,$fd);
_______________________________________________
Bug-gnupod mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/bug-gnupod

Reply via email to