Fix watching new subdirs in collection watcher
This commit is contained in:
parent
2d3f41da6f
commit
7b13c0d059
|
@ -143,15 +143,7 @@ CollectionWatcher::ScanTransaction::~ScanTransaction() {
|
||||||
|
|
||||||
// If we're stopping then don't commit the transaction
|
// If we're stopping then don't commit the transaction
|
||||||
if (!watcher_->stop_requested_) {
|
if (!watcher_->stop_requested_) {
|
||||||
|
|
||||||
CommitNewOrUpdatedSongs();
|
CommitNewOrUpdatedSongs();
|
||||||
|
|
||||||
if (watcher_->monitor_) {
|
|
||||||
// Watch the new subdirectories
|
|
||||||
for (const Subdirectory &subdir : new_subdirs) {
|
|
||||||
watcher_->AddWatch(watcher_->watched_dirs_[dir_], subdir.path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
watcher_->task_manager_->SetTaskFinished(task_id_);
|
watcher_->task_manager_->SetTaskFinished(task_id_);
|
||||||
|
@ -196,7 +188,6 @@ void CollectionWatcher::ScanTransaction::CommitNewOrUpdatedSongs() {
|
||||||
|
|
||||||
if (!new_subdirs.isEmpty()) {
|
if (!new_subdirs.isEmpty()) {
|
||||||
emit watcher_->SubdirsDiscovered(new_subdirs);
|
emit watcher_->SubdirsDiscovered(new_subdirs);
|
||||||
new_subdirs.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!touched_subdirs.isEmpty()) {
|
if (!touched_subdirs.isEmpty()) {
|
||||||
|
@ -204,6 +195,15 @@ void CollectionWatcher::ScanTransaction::CommitNewOrUpdatedSongs() {
|
||||||
touched_subdirs.clear();
|
touched_subdirs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (watcher_->monitor_) {
|
||||||
|
// Watch the new subdirectories
|
||||||
|
for (const Subdirectory &subdir : new_subdirs) {
|
||||||
|
watcher_->AddWatch(watcher_->watched_dirs_[dir_], subdir.path);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new_subdirs.clear();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue