Ticket #665: mythmusic-speedup-lastplay.patch

File mythmusic-speedup-lastplay.patch, 884 bytes (added by mythtv@…, 15 years ago)

Convert directly from string of date to double

  • mythmusic/mythmusic/metadata.cpp

     
    638638{
    639639    QString timestamp = lastplay;
    640640
    641     if(timestamp.contains('-') < 1)
    642     {
    643         timestamp.insert(4, '-');
    644         timestamp.insert(7, '-');
    645         timestamp.insert(10, 'T');
    646         timestamp.insert(13, ':');
    647         timestamp.insert(16, ':');
    648     }
    649 
    650     QDateTime lTime = QDateTime::fromString(timestamp, Qt::ISODate);
    651     double lastDateTime = lTime.toString("yyyyMMddhhmmss").toDouble();
    652     return lastDateTime;
     641    timestamp = timestamp.replace(':', "");
     642    timestamp = timestamp.replace('T', "");
     643    timestamp = timestamp.replace('-', "");
     644    return timestamp.toDouble();
    653645}
    654646
    655647void Metadata::setLastPlay()