format_parser icon indicating copy to clipboard operation
format_parser copied to clipboard

Fixing a bug in id3tag when mapping ID3 tags to intrinsics

Open julik opened this issue 7 years ago • 1 comments

With our fixtures id3tag raises an exception when addressing Tag#genre apparently.

 1) FormatParser::MP3Parser decodes and estimates duration for a CBR MP3
     Failure/Error: value = tag.public_send(k)
     
     NoMethodError:
       undefined method `gsub' for nil:NilClass
     # /Users/julik/Code/libs/id3tag/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24.rb:25:in `just_genres'
     # /Users/julik/Code/libs/id3tag/lib/id3tag/frames/v2/genre_frame/genre_parser_pre_24.rb:12:in `genres'
     # /Users/julik/Code/libs/id3tag/lib/id3tag/frames/v2/genre_frame.rb:23:in `get_genres'
     # /Users/julik/Code/libs/id3tag/lib/id3tag/frames/v2/genre_frame.rb:8:in `genres'

I've pushed a branch called id3tag-bug which demonstrates it. We need to find out why that happens, create a minimal test case and file a PR for https://github.com/krists/id3tag

The rescue nil clause in the MP3 parser code can then be removed.

julik avatar May 11 '18 09:05 julik

Hello @julik,

After a small investigation around the gem id3tag the issue with the call on nil seems to be fixed by now. I will wait until a new tag is released in order to make it safe to remove the rescue nil. Yaay! 🎉 Always nice to clean up these edge cases from the code.

alex-quiterio avatar Jun 13 '18 08:06 alex-quiterio