Hi,
I'm the developer of Rubyripper and am using ruby-freedb for my program. I would much appreciate if you could update
ruby-freedb to support freedb procotol level 6 instead of 5. This shouldn't take much code, as I wrote the connection
now myself.
In protocol 5 often the year value is missing. This can be easily solved by setting the protocol to 6. Even then however
your way of extracting values out of the freedb response seems a bit difficult to understand. It even then fails to
extract the year value. Why not simply as I do now:
def cd_vars
#Make some usefull variables from the raw_response.
@raw_response.each do |line|
if line =~ /DTITLE/
(@artist, @album) = line[7..-1].split(/\s*\/\s*/)
clean(@artist)
clean(@album)
elsif line =~ /DYEAR/
@year = line[6..-1].chomp!
elsif line =~ /DGENRE/
@genre = line[7..-1].chomp!
elsif line =~ /TTITLE\d*=/
trackname = "#{$'}"
@tracklist << clean(trackname)
end
end
end
def clean(var)
#check for weird characters and take only the name till the weird character occurs.
var.chomp!
if var.index(/[\[\]\/]/)
var = "#{$`}"
end
var.rstrip!
return var
end
Where I have already throw away all lines that start with a '#' in @raw_response.
Regards,
Bouke |