FXint GMTagUpdateTask::run() { try { GMTrack info; database->beginTask(); for (FXival i=0;i<tracks.no() && processing;i++) { if (database->interrupt) database->waitTask(); if (!database->getTrack(tracks[i],info)) { break; } taskmanager->setStatus(FXString::value("Writing Tags %ld/%ld..",i+1,tracks.no())); info.saveTag(info.url); database->setTrackImported(tracks[i],FXThread::time()); } database->commitTask(); } catch(GMDatabaseException&) { database->rollbackTask(); return 1; } return 0; }
FXint GMUpdateTask::run() { try { for (FXival i=0;i<tracks.no() && processing;i++) { taskmanager->setStatus(FXString::value("Writing Tags %ld/%ld..",i+1,tracks.no())); tracks[i].saveTag(tracks[i].url); database->beginTask(); database->setTrackImported(ids[i],FXThread::time()); database->commitTask(); } } catch(GMDatabaseException&) { database->rollbackTask(); return 1; } return 0; }
FXint GMUpdateTask::run() { try { GMTaskTransaction transaction(database); for (FXival i=0;i<tracks.no() && processing;i++) { taskmanager->setStatus(FXString::value("Writing Tags %ld/%ld..",i+1,tracks.no())); tracks[i].saveTag(tracks[i].url); if (database->interrupt) transaction.pause(); database->setTrackImported(ids[i],FXThread::time()); } transaction.commit(); } catch(GMDatabaseException&) { return 1; } return 0; }