mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 20:13:36 +00:00
Actually maybe for real fix indexer track count events?
This commit is contained in:
parent
d5ad390a77
commit
ca92052ad1
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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()) {
|
||||
|
Loading…
Reference in New Issue
Block a user