Esempio n. 1
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;
  }
Esempio n. 2
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;
  }