Actually maybe for real fix indexer track count events?

This commit is contained in:
casey langen 2020-02-02 17:04:56 -08:00
parent d5ad390a77
commit ca92052ad1
3 changed files with 5 additions and 12 deletions

View File

@ -404,7 +404,6 @@ void Indexer::ReadMetadataFromFile(
INC(track, "album_artist", i);
INC(track, "album", i);
track.Save(this->dbConnection, this->libraryPath);
this->filesSaved++;
}
#endif
}
@ -429,7 +428,7 @@ inline void Indexer::IncrementTracksScanned(size_t delta) {
if (this->incrementalUrisScanned > TRANSACTION_INTERVAL) {
this->trackTransaction->CommitAndRestart();
this->Progress(this->incrementalUrisScanned);
this->Progress(this->totalUrisScanned);
this->incrementalUrisScanned = 0;
}
}
@ -623,9 +622,8 @@ void Indexer::ThreadLoop() {
this->dbConnection.Close();
this->Progress(this->incrementalUrisScanned);
if (!this->Bail()) {
this->Progress(this->totalUrisScanned);
this->Finished(this->totalUrisScanned);
}
@ -1038,8 +1036,7 @@ void Indexer::CommitProgress(IIndexerSource* source, unsigned updatedTracks) {
}
if (updatedTracks) {
std::unique_lock<std::mutex> lock(IndexerTrack::sharedWriteMutex);
this->Progress((int) updatedTracks);
this->IncrementTracksScanned(updatedTracks);
}
}

View File

@ -36,16 +36,12 @@ static void sleep_for(const char* tag, int seconds) {
}
}
static int total_indexer_updated_count = 0;
static void indexer_started_callback(mcsdk_svc_indexer in) {
total_indexer_updated_count = 0;
printf("[indexer_started_callback]\n");
}
static void indexer_progress_callback(mcsdk_svc_indexer in, int updated_count) {
total_indexer_updated_count += updated_count;
printf("[indexer_progress_callback] %d\n", total_indexer_updated_count);
printf("[indexer_progress_callback] %d\n", updated_count);
}
static void indexer_finished_callback(mcsdk_svc_indexer in, int total_updated_count) {

View File

@ -212,7 +212,7 @@ void MainLayout::ProcessMessage(musik::core::runtime::IMessage &message) {
this->Layout();
}
else if (type == message::IndexerProgress) {
this->syncUpdateCount += (int)message.UserData1();
this->syncUpdateCount == (int) message.UserData1();
updateSyncingText(this->syncing.get(), this->syncUpdateCount);
if (!syncing->IsVisible()) {