mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
park all clients waiting for a transcode
This commit is contained in:
parent
44909cc7b8
commit
c48f469e39
|
@ -200,7 +200,7 @@ class ThumbSrv(object):
|
||||||
self.log("wait {}".format(tpath))
|
self.log("wait {}".format(tpath))
|
||||||
except:
|
except:
|
||||||
thdir = os.path.dirname(tpath)
|
thdir = os.path.dirname(tpath)
|
||||||
bos.makedirs(thdir)
|
bos.makedirs(os.path.join(thdir, "w"))
|
||||||
|
|
||||||
inf_path = os.path.join(thdir, "dir.txt")
|
inf_path = os.path.join(thdir, "dir.txt")
|
||||||
if not bos.path.exists(inf_path):
|
if not bos.path.exists(inf_path):
|
||||||
|
@ -272,9 +272,12 @@ class ThumbSrv(object):
|
||||||
if not png_ok and tpath.endswith(".png"):
|
if not png_ok and tpath.endswith(".png"):
|
||||||
raise Pebkac(400, "png only allowed for waveforms")
|
raise Pebkac(400, "png only allowed for waveforms")
|
||||||
|
|
||||||
|
tdir, tfn = os.path.split(tpath)
|
||||||
|
ttpath = os.path.join(tdir, "w", tfn)
|
||||||
|
|
||||||
for fun in funs:
|
for fun in funs:
|
||||||
try:
|
try:
|
||||||
fun(abspath, tpath)
|
fun(abspath, ttpath)
|
||||||
break
|
break
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
msg = "{} could not create thumbnail of {}\n{}"
|
msg = "{} could not create thumbnail of {}\n{}"
|
||||||
|
@ -283,12 +286,17 @@ class ThumbSrv(object):
|
||||||
self.log(msg, c)
|
self.log(msg, c)
|
||||||
if getattr(ex, "returncode", 0) != 321:
|
if getattr(ex, "returncode", 0) != 321:
|
||||||
if fun == funs[-1]:
|
if fun == funs[-1]:
|
||||||
with open(tpath, "wb") as _:
|
with open(ttpath, "wb") as _:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# ffmpeg may spawn empty files on windows
|
# ffmpeg may spawn empty files on windows
|
||||||
try:
|
try:
|
||||||
os.unlink(tpath)
|
os.unlink(ttpath)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
bos.rename(ttpath, tpath)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue