[mythtv-commits] Ticket #3645: MythMusic CD-ripper: UTF8 and year issue
MythTV
mythtv at cvs.mythtv.org
Mon Jul 16 12:10:17 UTC 2007
#3645: MythMusic CD-ripper: UTF8 and year issue
----------------------------------+-----------------------------------------
Reporter: otto at kolsi dot fi | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: unknown
Component: mythmusic | Version: head
Severity: medium | Resolution:
Mlocked: 0 |
----------------------------------+-----------------------------------------
Comment(by nigel):
A few years ago, UTF8 conversion was added to the CDDB lookup [5215]. I am
still researching, but I think that was slightly wrong, because most CDDB
data doesn't seem to be UTF8. The most correct way to fix this would be to
check for UTF8 escape sequences, but here is my quick fix:
{{{
Index: cddecoder.cpp
===================================================================
--- cddecoder.cpp (revision 13626)
+++ cddecoder.cpp (working copy)
@@ -398,7 +398,7 @@
return NULL;
}
- compilation_artist = QString::fromUtf8(discdata.data_artist);
+ compilation_artist = discdata.data_artist;
if (compilation_artist.lower().left(7) == "various")
{
@@ -406,7 +406,7 @@
}
- album = QString::fromUtf8(discdata.data_title);
+ album = discdata.data_title;
genre = cddb_genre(discdata.data_genre);
if (!genre.isEmpty())
@@ -416,8 +416,8 @@
genre = flet + rt;
}
- title = QString::fromUtf8(discdata.data_track[tracknum -
1].track_name);
- artist = QString::fromUtf8(discdata.data_track[tracknum -
1].track_artist);
+ title = discdata.data_track[tracknum - 1].track_name;
+ artist = discdata.data_track[tracknum - 1].track_artist;
if (artist.length() < 1)
{
@@ -425,6 +425,14 @@
compilation_artist = "";
}
+ if (CDDB_PROTOCOL_LEVEL > 5) // Proto 6 (and above?) supposedly UTF8
+ {
+ compilation_artist = QString::fromUtf8(compilation_artist);
+ album = QString::fromUtf8(album);
+ title = QString::fromUtf8(title);
+ artist = QString::fromUtf8(artist);
+ }
+
if (title.length() < 1)
title = QString(QObject::tr("Track %1")).arg(tracknum);
}}}
As for the year, libcdaudio was written before this was added to the CDDB
database (protocol level 5?). My Darwin Qt CDDB lookup does the right
thing, but it is a while before that will be used for Linux as well.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/3645#comment:2>
MythTV <http://svn.mythtv.org/trac>
MythTV
More information about the mythtv-commits
mailing list