toomasadam / aloxripper

Automatically exported from code.google.com/p/rubyripper
0 stars 0 forks source link

Track name cleanup a bit too aggressive #69

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I attempted to rip a various artists disc, where each track was named eg:
"The Band / The Name of the Song".

The existing clean() method truncates any string at the point it finds a
"[", "]", or "/" (though the comment says backslash, it actually looks for
forward slashes).

I'd prefer it just "neutralize" offending characters so can I suggest doing
something like this instead? (see patch)

(Thanks, by the way -- rubyripper is working great for me!)

Original issue reported on code.google.com by stearns%...@gtempaccount.com on 18 Mar 2007 at 12:54

Attachments:

GoogleCodeExporter commented 9 years ago
Although you're right, it's old code you're comparing to. I think it nowadays 
already does what you want, since the cleanup function has been enhanced (see 
latest svn version):

def clean(var) 
  var.gsub!('`', "'") #replace a backquote with a single quote
  var.gsub!('"', '') #remove the double quote chars
  var.gsub!('[', '(') #replace the ' [ ' with a ' ( '
  var.gsub!(']', ')') #replace the ' ] ' with a ' ) '
  var.gsub!('/', ' ') #remove any '/'
  var.gsub!('\\', ' ') #remove any '\', the \\ means a normal \
  var.gsub!('_', ' ') # replace any underscores with spaces, some freedb info got 
underscores instead of spaces
  var.strip!
end

Original comment by rubyripp...@gmail.com on 18 Mar 2007 at 3:06