From e70c74a3b5b52d9ecda72f8f07b7d3501d4394d7 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 23 Mar 2021 00:08:23 +0100 Subject: [PATCH] support nullmapping subfolders with -v :/foo/bar:cd2d --- copyparty/up2k.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index c6fd60ae..f764ce09 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -282,9 +282,12 @@ class Up2k(object): dbw = [reg[0], 0, time.time()] self.pp.n = next(dbw[0].execute("select count(w) from up"))[0] - # can be symlink so don't `and d.startswith(top)`` - excl = set([d.realpath for d in all_vols if d != vol]) - n_add = self._build_dir(dbw, top, excl, top) + excl = [ + vol.realpath + d.vpath[len(vol.vpath) :] + for d in all_vols + if d.vpath.startswith(vol.vpath + "/") + ] + n_add = self._build_dir(dbw, top, set(excl), top) n_rm = self._drop_lost(dbw[0], top) if dbw[1]: self.log("commit {} new files".format(dbw[1]))