Problems with id3lib-ruby

B

Bira

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 :).
 
R

Robin Stocker

Bira said:
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 :).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,918
Members
47,458
Latest member
Chris#

Latest Threads

Top