Ticket #6403: mythmusic.patch

File mythmusic.patch, 2.3 KB (added by sub@…, 15 years ago)

Patch to read only up to the fourth character of the DATE comment

  • release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp

    diff -Nur --ignore-all-space --exclude='*~' original/release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp edit/release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp
    old new  
    189189        album = getComment(block, MYTH_VORBISCOMMENT_ALBUM);
    190190        genre = getComment(block, MYTH_VORBISCOMMENT_GENRE);
    191191        tracknum = getComment(block, MYTH_VORBISCOMMENT_TRACK).toInt();
    192         year = getComment(block, MYTH_VORBISCOMMENT_DATE).toInt();
     192        // DATE comments may contain YYYY-MM-DD followed by other characters.
     193        // The year is extracted by converting up to the fourth character only.
     194        year = getComment(block, MYTH_VORBISCOMMENT_DATE).left(4).toInt();
    193195       
    194196        QString tmp = getComment(block,
    195197                                 MYTH_VORBISCOMMENT_MUSICBRAINZ_ALBUMARTISTID);
  • release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp

    diff -Nur --ignore-all-space --exclude='*~' original/release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp edit/release-0-21-fixes/mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp
    old new  
    305305            title = getComment(comment, MYTH_VORBISCOMMENT_TITLE);
    306306            genre = getComment(comment, MYTH_VORBISCOMMENT_GENRE);
    307307            tracknum = atoi(getComment(comment, MYTH_VORBISCOMMENT_TRACK).ascii());
    308             year = atoi(getComment(comment, MYTH_VORBISCOMMENT_DATE).ascii());
     308            // DATE comments may contain YYYY-MM-DD followed by other
     309            // characters. The year is extracted by converting up to the fourth
     310            // character only.
     311            year = atoi(getComment(comment, MYTH_VORBISCOMMENT_DATE).left(4).ascii());
    309312           
    310313            QString tmp = getComment(comment, MYTH_VORBISCOMMENT_MUSICBRAINZ_ALBUMARTISTID);
    311314            compilation = (MYTH_MUSICBRAINZ_ALBUMARTIST_UUID == tmp);