Flush debug output. Don't VACUUM database every time.

This commit is contained in:
Markus Birth 2021-04-26 16:53:39 +02:00
parent e12d130aa6
commit 975c584adc
2 changed files with 6 additions and 5 deletions

View File

@ -17,7 +17,8 @@ class MosDb():
def finish(self):
if self.changes_made:
self.c.execute("VACUUM")
pass
#self.c.execute("VACUUM")
self.conn.commit()
self.conn.close()

View File

@ -45,7 +45,7 @@ for f in todo:
objFile = objPath.replace(CLIP_PATH_TRANSFORM_FROM, CLIP_PATH_TRANSFORM_TO).replace("\\", "/")
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
cmd = [LOUDNESS_SCANNER, "scan", "-l", objFile]
@ -62,7 +62,7 @@ for f in todo:
continue
lufs = m.group(1)
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":
lufs = -99.0
lra = 0.0
@ -72,13 +72,13 @@ for f in todo:
lufs = float(lufs) + 3.0
lra = float(lra)
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)
have_lufs = True
break
if not have_lufs:
print("ERROR analysing file for {}: {}".format(objId, objFile))
print("ERROR analysing file for {}: {}".format(objId, objFile), flush=True)
db.finish()