Browse Source

add timings automatically

David 9 years ago
parent
commit
993d9ba401
1 changed files with 4 additions and 1 deletions
  1. 4 1
      back/watch.py

+ 4 - 1
back/watch.py

@@ -8,6 +8,7 @@ import subprocess
 import sys
 import os
 import pyinotify
+import audio_timings
 
 from db import db,file_info
 from constants  import RAW_PATH
@@ -42,7 +43,9 @@ class OnWriteHandler(pyinotify.ProcessEvent):
         if rc != 0:
             print("Error?")
             return
-        d.insert_raw(file_info(out_fname))
+        info = file_info(out_fname)
+        info['timings'] = audio_timings.parse_file(out_fname)
+        d.insert_raw(info)
 
     def process_IN_CLOSE_WRITE(self, event):
         if not event.pathname.endswith(self.extension):