Ticket #449: mythmusic.patch

File mythmusic.patch, 3.0 KB (added by mythtv@…, 19 years ago)

Patch to change filename conversions to ASCII from UTF8.

  • mythmusic/mythmusic/main.cpp

    diff -ru ../mythplugins-0.18.1/mythmusic/mythmusic/main.cpp mythmusic/mythmusic/main.cpp
    old new  
    191191    {
    192192        while (query.next())
    193193        {
    194             QString name = directory + QString::fromUtf8(query.value(0).toString());
     194            QString name = directory + QString::fromAscii(query.value(0).toString());
    195195            if (name != QString::null)
    196196            {
    197197                if ((iter = music_files.find(name)) != music_files.end())
     
    223223
    224224            query.prepare("DELETE FROM musicmetadata WHERE "
    225225                          "filename = :NAME ;");
    226             query.bindValue(":NAME", name.utf8());
     226            query.bindValue(":NAME", name.ascii());
    227227            query.exec();
    228228        }
    229229
  • mythmusic/mythmusic/metadata.cpp

    diff -ru ../mythplugins-0.18.1/mythmusic/mythmusic/metadata.cpp mythmusic/mythmusic/metadata.cpp
    old new  
    9999    query.prepare("SELECT artist,compilation_artist,album,title,genre,year,tracknum,"
    100100                  "length,intid,rating,playcount,lastplay,compilation FROM "
    101101                  "musicmetadata WHERE filename = :FILENAME ;");
    102     query.bindValue(":FILENAME", sqlfilename.utf8());
     102    query.bindValue(":FILENAME", sqlfilename.ascii());
    103103
    104104    if (query.exec() && query.isActive() && query.size() > 0)
    105105    {
     
    175175    query.bindValue(":YEAR", year);
    176176    query.bindValue(":TRACKNUM", tracknum);
    177177    query.bindValue(":LENGTH", length);
    178     query.bindValue(":FILENAME", sqlfilename.utf8());
     178    query.bindValue(":FILENAME", sqlfilename.ascii());
    179179    query.bindValue(":COMPILATION", compilation);
    180180    query.bindValue(":DATE_ADDED", QDate::currentDate());
    181181   
     
    505505        year = query.value(5).toInt();
    506506        tracknum = query.value(6).toInt();
    507507        length = query.value(7).toInt();
    508         filename = QString::fromUtf8(query.value(8).toString());
     508        filename = QString::fromAscii(query.value(8).toString());
    509509        id = query.value(9).toUInt();
    510510        rating = query.value(10).toInt();
    511511        playcount = query.value(11).toInt();
     
    541541        year = query.value(6).toInt();
    542542        tracknum = query.value(7).toInt();
    543543        length = query.value(8).toInt();
    544         filename = QString::fromUtf8(query.value(9).toString());
     544        filename = QString::fromAscii(query.value(9).toString());
    545545        rating = query.value(10).toInt();
    546546        playcount = query.value(11).toInt();
    547547        lastplay = query.value(12).toString();
     
    690690    {
    691691        while (query.next())
    692692        {
    693             filename = QString::fromUtf8(query.value(9).toString());
     693            filename = QString::fromAscii(query.value(9).toString());
    694694            if (!filename.contains("://"))
    695695                filename = startdir + filename;
    696696