Flush debug output. Don't VACUUM database every time.
This commit is contained in:
parent
e12d130aa6
commit
975c584adc
3
MosDb.py
3
MosDb.py
@ -17,7 +17,8 @@ class MosDb():
|
|||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
if self.changes_made:
|
if self.changes_made:
|
||||||
self.c.execute("VACUUM")
|
pass
|
||||||
|
#self.c.execute("VACUUM")
|
||||||
self.conn.commit()
|
self.conn.commit()
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ for f in todo:
|
|||||||
objFile = objPath.replace(CLIP_PATH_TRANSFORM_FROM, CLIP_PATH_TRANSFORM_TO).replace("\\", "/")
|
objFile = objPath.replace(CLIP_PATH_TRANSFORM_FROM, CLIP_PATH_TRANSFORM_TO).replace("\\", "/")
|
||||||
|
|
||||||
if not os.path.isfile(objFile):
|
if not os.path.isfile(objFile):
|
||||||
print("ERROR: File not found: {}".format(objFile), file=sys.stderr)
|
print("ERROR: File not found: {}".format(objFile), file=sys.stderr, flush=True)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
cmd = [LOUDNESS_SCANNER, "scan", "-l", objFile]
|
cmd = [LOUDNESS_SCANNER, "scan", "-l", objFile]
|
||||||
@ -62,7 +62,7 @@ for f in todo:
|
|||||||
continue
|
continue
|
||||||
lufs = m.group(1)
|
lufs = m.group(1)
|
||||||
lra = m.group(2)
|
lra = m.group(2)
|
||||||
print("Found LUFS for {}: {} (LRA: {} LU)".format(objId, lufs, lra), end="")
|
print("Found LUFS for {}: {} (LRA: {} LU)".format(objId, lufs, lra), end="", flush=True)
|
||||||
if lufs == "-inf":
|
if lufs == "-inf":
|
||||||
lufs = -99.0
|
lufs = -99.0
|
||||||
lra = 0.0
|
lra = 0.0
|
||||||
@ -72,13 +72,13 @@ for f in todo:
|
|||||||
lufs = float(lufs) + 3.0
|
lufs = float(lufs) + 3.0
|
||||||
lra = float(lra)
|
lra = float(lra)
|
||||||
ldiff = lufs - TARGET_LUFS
|
ldiff = lufs - TARGET_LUFS
|
||||||
print(", diff to {}: {}".format(TARGET_LUFS, ldiff))
|
print(", diff to {}: {}".format(TARGET_LUFS, ldiff), flush=True)
|
||||||
db.set_lufs(objId, lufs, lra, ldiff)
|
db.set_lufs(objId, lufs, lra, ldiff)
|
||||||
have_lufs = True
|
have_lufs = True
|
||||||
break
|
break
|
||||||
|
|
||||||
if not have_lufs:
|
if not have_lufs:
|
||||||
print("ERROR analysing file for {}: {}".format(objId, objFile))
|
print("ERROR analysing file for {}: {}".format(objId, objFile), flush=True)
|
||||||
|
|
||||||
db.finish()
|
db.finish()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user