[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnupod] mktunes.pl creates corrupt iTunesDB ?

From: H. Langos
Subject: Re: [Bug-gnupod] mktunes.pl creates corrupt iTunesDB ?
Date: Wed, 17 Jun 2009 13:44:28 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Wed, Jun 17, 2009 at 12:11:06PM +0200, Richard van den Berg wrote:
> On Wed, June 17, 2009 10:41, H. Langos wrote:
> > Your mhod skipping code should only be active if that option is set in
> > your .gnupodrc or given as command line switch.
> That is the case now. If keppattr is not set, @keep is empty and $#keep =
> -1 and nothing will be filtered. I wouldn't have written it any other way.

Ahh, I see ... my brain isn't used to "unless" statements...
I need to translate it to 
  next unless ($#keep<0 || grep(/^$key$/,@keep)); #Only keep specific mhods
  next if ($#keep=>0 && !grep(/^$key$/,@keep)); #Only keep specific mhods
to understand it right :-)

> > Did you find out if shrinking the existing attributes (in contrast to
> > skipping) had any effect?
> It has effect on the iTunesDB size for sure, but not as drastically as
> removing mhods. I can do more testing to see if it has an effect on the
> iPod accepting the iTunesDB, but I am rather fed up with binary searches
> at the moment. It takes a lot of time. I'd have to find the critical point
> in my current configuration and then use the size of the mhods to see if I
> can push it over or under this point.

I don't think we need tu hurry that. It just would be nice to have some
numbers when warning users about possible memory issues.
> > You only need to rerun tunes2pod if your GNUtunesDB.xml is lost or if you
> > played around with iTunes in the meantime ... and we could warn people
> > about this.
> I don't plan on using iTunes, but I could see myself using Floola in
> combination with gnupod.

Wow, Floola looks realy nice. I understand your concern now. This would also 
be important for people who use gnupod and gtkpod or any other libgpod based 

So tunes2pod would have to be improved to incorporate new files and playlists 
and accept changes to existing attributes but to keep those attributes that 
it already finds in GNUtunesDB.xml.

> > BTW: Does iTunes manage to get your full collection over to your ipod, or
> > does it also produce an unusable iTunesDB?
> I don't have my collection loaded in iTunes. I was saving that as a last
> resort. Perhaps I'll give it a try over the weekend, after making sure it
> can only access my collection read-only.

That would be fun and interesting to see which strategy iTunes chooses to
save space.
> > Code remarks: I like the passing of optional arguments in a hash. However
> > I strongly suggest using lower case keys (keep instead of Keep and item
> > instead of Item.)
> I though I was using the gnupod coding convention there. I don't like it
> either, so I'll fix the other capitalized keys as well.

Yes but please keep those changes capitalization changes limited to your new
code. I'd liek to put of big cleanup actions until we get the git repository
up and runing. 

I've got things like "whitespace cleanup" and "use warnings;" for the old
code on my TODO list.

> Does $value evaluate to false when it is an empty string? I am planning to
> check which mhods I am now actually filtering. I was quite surprised by
> the size decrease my patch caused. Perhaps there are some mhods that
> should be filtered by default.

from "man perlsyn":
   Truth and Falsehood
       The number 0, the strings '0' and '', the empty list "()", and
       "undef" are all false in a boolean context. All other values are true.
       Negation of a true value by "!" or "not" returns a special false value.
       When evaluated as a string it is treated as '', but as a number, it is 
       treated as 0.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]