mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
treat symlinks as regular files in db
This commit is contained in:
parent
1359213196
commit
e3684e25f8
|
@ -164,8 +164,6 @@ small collection of user feedback
|
||||||
|
|
||||||
* all volumes must exist / be available on startup; up2k (mtp especially) gets funky otherwise
|
* all volumes must exist / be available on startup; up2k (mtp especially) gets funky otherwise
|
||||||
* cannot mount something at `/d1/d2/d3` unless `d2` exists inside `d1`
|
* cannot mount something at `/d1/d2/d3` unless `d2` exists inside `d1`
|
||||||
* dupe files will not have metadata (audio tags etc) displayed in the file listing
|
|
||||||
* because they don't get `up` entries in the db (probably best fix) and `tx_browser` does not `lstat`
|
|
||||||
* probably more, pls let me know
|
* probably more, pls let me know
|
||||||
|
|
||||||
## not my bugs
|
## not my bugs
|
||||||
|
|
|
@ -1094,6 +1094,11 @@ class Up2k(object):
|
||||||
os.unlink(fsenc(dst)) # TODO ed pls
|
os.unlink(fsenc(dst)) # TODO ed pls
|
||||||
self._symlink(src, dst)
|
self._symlink(src, dst)
|
||||||
|
|
||||||
|
if cur:
|
||||||
|
a = [cj[x] for x in "prel name lmod size".split()]
|
||||||
|
self.db_add(cur, wark, *a)
|
||||||
|
cur.connection.commit()
|
||||||
|
|
||||||
if not job:
|
if not job:
|
||||||
job = {
|
job = {
|
||||||
"wark": wark,
|
"wark": wark,
|
||||||
|
@ -1144,7 +1149,6 @@ class Up2k(object):
|
||||||
return f["orz"][1]
|
return f["orz"][1]
|
||||||
|
|
||||||
def _symlink(self, src, dst):
|
def _symlink(self, src, dst):
|
||||||
# TODO store this in linktab so we never delete src if there are links to it
|
|
||||||
self.log("linking dupe:\n {0}\n {1}".format(src, dst))
|
self.log("linking dupe:\n {0}\n {1}".format(src, dst))
|
||||||
if self.args.nw:
|
if self.args.nw:
|
||||||
return
|
return
|
||||||
|
@ -1236,15 +1240,8 @@ class Up2k(object):
|
||||||
a = [dst, job["size"], (int(time.time()), int(job["lmod"]))]
|
a = [dst, job["size"], (int(time.time()), int(job["lmod"]))]
|
||||||
self.lastmod_q.put(a)
|
self.lastmod_q.put(a)
|
||||||
|
|
||||||
# legit api sware 2 me mum
|
a = [job[x] for x in "ptop wark prel name lmod size".split()]
|
||||||
if self.idx_wark(
|
if self.idx_wark(*a):
|
||||||
job["ptop"],
|
|
||||||
job["wark"],
|
|
||||||
job["prel"],
|
|
||||||
job["name"],
|
|
||||||
job["lmod"],
|
|
||||||
job["size"],
|
|
||||||
):
|
|
||||||
del self.registry[ptop][wark]
|
del self.registry[ptop][wark]
|
||||||
# in-memory registry is reserved for unfinished uploads
|
# in-memory registry is reserved for unfinished uploads
|
||||||
|
|
||||||
|
@ -1256,7 +1253,7 @@ class Up2k(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.db_rm(cur, rd, fn)
|
self.db_rm(cur, rd, fn)
|
||||||
self.db_add(cur, wark, rd, fn, int(lmod), sz)
|
self.db_add(cur, wark, rd, fn, lmod, sz)
|
||||||
cur.connection.commit()
|
cur.connection.commit()
|
||||||
|
|
||||||
if "e2t" in self.flags[ptop]:
|
if "e2t" in self.flags[ptop]:
|
||||||
|
@ -1279,7 +1276,7 @@ class Up2k(object):
|
||||||
db.execute(sql, v)
|
db.execute(sql, v)
|
||||||
except:
|
except:
|
||||||
rd, fn = s3enc(self.mem_cur, rd, fn)
|
rd, fn = s3enc(self.mem_cur, rd, fn)
|
||||||
v = (wark, ts, sz, rd, fn)
|
v = (wark, int(ts), sz, rd, fn)
|
||||||
db.execute(sql, v)
|
db.execute(sql, v)
|
||||||
|
|
||||||
def _get_wark(self, cj):
|
def _get_wark(self, cj):
|
||||||
|
|
Loading…
Reference in a new issue