Forráskód Böngészése

Fix rescan wiping tracks outside scanned paths

Only mark entries as not-present if their track path falls under one
of the directories being rescanned, so a partial rescan (e.g. upload
dir only) no longer removes tracks from other library paths.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Innokentii Enikeev 3 hónapja
szülő
commit
8934c0a2af
1 módosított fájl, 7 hozzáadás és 1 törlés
  1. 7 1
      back/db.lisp

+ 7 - 1
back/db.lisp

@@ -106,7 +106,13 @@
     (declare (fixnum added updated removed))
 
     (loop for value being the hash-values in tracks-db
-       do (setf (entry-present value) nil))
+       do (let ((track (entry-track value)))
+            (when (and track
+                       (some (lambda (dir)
+                               (starts-with-subseq (namestring dir)
+                                                   (namestring (track-path track))))
+                             paths))
+              (setf (entry-present value) nil))))
 
     (unless (listp paths)
       (setf paths (list paths)))