Bira schrieb:
> Hello,
> 
> I'm trying to organize my MP3 collection using id3lib-ruby, to go
> through it and sort the files into artist/album folders according to
> their ID3 information.
> 
> However, in some files, my script breaks with the following message:
> 
> undefined method 'get_type' for nil:NilClass
> 
> The message corresponds to the following line:
> 
> tag = ID3Lib::Tag.new(mp3)
> 
> 'mp3' is a variable holding the name of the file being currently processed.
> 
> After a bit of testing and looking at the documentation for the "new"
> method, it seems this happens because a given file may have some
> invalid frames in its tag, or no frames at all (i.e, no tag).
> 
> Does anyone know if this is a bug or simply user error on my part? If
> it is a bug, I'll gladly report it on rubyforge, but if it's user
> error I'd like to know the correct way to go about this :).
> 

Hi,

It's a known bug, the tracker item is here:
http://rubyforge.org/tracker/index.php?func=detail&aid=6446&group_id=1384&atid=5449

The problem is fixed in SVN. It would be nice if you could try it out 
and post your results to the tracker item above. Here's what you would 
have to do:

   svn checkout svn://rubyforge.org/var/svn/id3lib-ruby/branches/0/ 
id3lib-ruby
   cd id3lib-ruby
   rake ext
   ruby -Ilib:ext -rid3lib -e 'ID3Lib::Tag.new(ARGV.first)' /path/to/mp3

Or you could wait for 0.4.2. Anyway, thanks for reporting :).

--
   Robin