mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
verify covers against db instead of fs
This commit is contained in:
parent
5af1575329
commit
e0c4829ec6
|
@ -1251,12 +1251,15 @@ class Up2k(object):
|
||||||
if n_rm2:
|
if n_rm2:
|
||||||
self.log("forgetting {} shadowed deleted files".format(n_rm2))
|
self.log("forgetting {} shadowed deleted files".format(n_rm2))
|
||||||
|
|
||||||
|
c2.connection.commit()
|
||||||
|
|
||||||
# then covers
|
# then covers
|
||||||
n_rm3 = 0
|
n_rm3 = 0
|
||||||
|
qu = "select 1 from up where rd=? and +fn=? limit 1"
|
||||||
q = "delete from cv where rd=? and dn=? and +fn=?"
|
q = "delete from cv where rd=? and dn=? and +fn=?"
|
||||||
for crd, cdn, fn in cur.execute("select * from cv"):
|
for crd, cdn, fn in cur.execute("select * from cv"):
|
||||||
ap = os.path.join(top, crd, cdn, fn)
|
urd = vjoin(crd, cdn)
|
||||||
if not bos.path.exists(ap):
|
if not c2.execute(qu, (urd, fn)).fetchone():
|
||||||
c2.execute(q, (crd, cdn, fn))
|
c2.execute(q, (crd, cdn, fn))
|
||||||
n_rm3 += 1
|
n_rm3 += 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue