Ticket #6403: mythmusic_trunk_r20321.patch

File mythmusic_trunk_r20321.patch, 2.1 KB (added by dslattery, 15 years ago)

Patch for mythmusic in trunk to improve parsing of the date comment in ogg and flac metadata

  • mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp

    diff -Nur --ignore-all-space --exclude='*~' trunk/mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp edit/mythplugins/mythmusic/mythmusic/metaioflacvorbiscomment.cpp
    old new  
    193193        album = getComment(block, MYTH_VORBISCOMMENT_ALBUM);
    194194        genre = getComment(block, MYTH_VORBISCOMMENT_GENRE);
    195195        tracknum = getComment(block, MYTH_VORBISCOMMENT_TRACK).toInt();
    196         year = getComment(block, MYTH_VORBISCOMMENT_DATE).toInt();
     196        // The date comment may be in the YYYY-MM-DD format so we should only
     197        // try to convert up to the fourth character.
     198        year = getComment(block, MYTH_VORBISCOMMENT_DATE).left(4).toInt();
    197199       
    198200        QString tmp = getComment(block,
    199201                                 MYTH_VORBISCOMMENT_MUSICBRAINZ_ALBUMARTISTID);
  • mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp

    diff -Nur --ignore-all-space --exclude='*~' trunk/mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp edit/mythplugins/mythmusic/mythmusic/metaiooggvorbiscomment.cpp
    old new  
    316316            title = getComment(comment, MYTH_VORBISCOMMENT_TITLE);
    317317            genre = getComment(comment, MYTH_VORBISCOMMENT_GENRE);
    318318            tracknum = getComment(comment, MYTH_VORBISCOMMENT_TRACK).toUInt();
    319             year = getComment(comment, MYTH_VORBISCOMMENT_DATE).toInt();
     319            // The date comment may be in the YYYY-MM-DD format so we should
     320            // only try to convert up to the fourth character.
     321            year = getComment(comment, MYTH_VORBISCOMMENT_DATE).left(4).toInt();
    320322           
    321323            QString tmp = getComment(comment, MYTH_VORBISCOMMENT_MUSICBRAINZ_ALBUMARTISTID);
    322324            compilation = (MYTH_MUSICBRAINZ_ALBUMARTIST_UUID == tmp);