From e396c5c2b53c682b135f6a3549ce157b33dbd0cc Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 8 May 2024 20:03:51 +0000 Subject: [PATCH] only drop index caches if necessary; prevents having to rebuild covers due to unrelated changes --- copyparty/up2k.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 92d040a2..bfb40530 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1039,8 +1039,11 @@ class Up2k(object): return None def _verify_db_cache(self, cur: "sqlite3.Cursor", vpath: str) -> None: - # check if volume config changed since last use; drop caches if so - zsl = [vpath] + list(sorted(self.asrv.vfs.all_vols.keys())) + # check if list of intersecting volumes changed since last use; drop caches if so + prefix = (vpath + "/").lstrip("/") + zsl = [x for x in self.asrv.vfs.all_vols if x.startswith(prefix)] + zsl = [x[len(prefix) :] for x in zsl] + zsl.sort() zb = hashlib.sha1("\n".join(zsl).encode("utf-8", "replace")).digest() vcfg = base64.urlsafe_b64encode(zb[:18]).decode("ascii")