1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-15 10:14:43 +01:00

Fix rescan when collection directory is removed and added

This commit is contained in:
Jonas Kvinge 2021-04-11 01:01:57 +02:00
parent 4983c1cfc9
commit 460d045cbe

View File

@ -908,8 +908,18 @@ void CollectionWatcher::PerformScan(bool incremental, bool ignore_mtimes) {
for (const Directory &dir : dirs) {
if (stop_requested_) break;
ScanTransaction transaction(this, dir.id, incremental, ignore_mtimes, mark_songs_unavailable_);
SubdirectoryList subdirs(transaction.GetAllSubdirs());
if (subdirs.isEmpty()) {
qLog(Debug) << "Collection directory wasn't in subdir list.";
Subdirectory subdir;
subdir.path = dir.path;
subdir.directory_id = dir.id;
subdirs << subdir;
}
transaction.AddToProgressMax(subdirs.count());
for (const Subdirectory &subdir : subdirs) {