diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index f2fdb6a3..aaae8419 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -5229,9 +5229,11 @@ class HttpCli(object): vdir = "%s/" % (rd,) if rd else "" q = "select sz, nf from ds where rd=? limit 1" for fe in dirs: - hit = icur.execute(q, (vdir + fe["name"],)).fetchone() - if hit: + try: + hit = icur.execute(q, (vdir + fe["name"],)).fetchone() (fe["sz"], fe["tags"][".files"]) = hit + except: + pass # 404 or mojibake taglist = [k for k in lmte if k in tagset] else: diff --git a/copyparty/up2k.py b/copyparty/up2k.py index 85171f4f..9f61d399 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -1424,11 +1424,14 @@ class Up2k(object): if not self.args.no_dirsz: tnf += len(files) q = "select sz, nf from ds where rd=? limit 1" - db_sz, db_nf = db.c.execute(q, (rd,)).fetchone() or (-1, -1) - if rsz != db_sz or tnf != db_nf: - db.c.execute("delete from ds where rd=?", (rd,)) - db.c.execute("insert into ds values (?,?,?)", (rd, rsz, tnf)) - db.n += 1 + try: + db_sz, db_nf = db.c.execute(q, (rd,)).fetchone() or (-1, -1) + if rsz != db_sz or tnf != db_nf: + db.c.execute("delete from ds where rd=?", (rd,)) + db.c.execute("insert into ds values (?,?,?)", (rd, rsz, tnf)) + db.n += 1 + except: + pass # mojibake rd # folder of 1000 files = ~1 MiB RAM best-case (tiny filenames); # free up stuff we're done with before dhashing