Skip to content
Browse files

small fix, but should prevents mongodb crash because of bad encoding...

  • Loading branch information...
1 parent b9cadbd commit 9c7695e502f88129d62334fec086db43add0c434 Arthur PETRY committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/track_info.rb
View
2 app/models/track_info.rb
@@ -52,7 +52,7 @@ def to_hash
}
end
if mp3?
- Mp3Info.open(filename) do |mp3|
+ Mp3Info.open(filename, :encoding => "utf-8") do |mp3|
cover = mp3.tag2["PIC"] || mp3.tag2["APIC"]
# cover.sub!(/\000(PNG|JPG).\000/,"") if mp3.tag2['PIC']
cover = cover[6..-1] if mp3.tag2['PIC'] && cover[0] == 0 && (cover[1..3] == "PNG" || cover[1..3] == "JPG") && cover[5] == 0

0 comments on commit 9c7695e

Please sign in to comment.
Something went wrong with that request. Please try again.