|
@@ -70,7 +70,6 @@ recognizer = FilePerSecondRecognizer
|
|
# settings
|
|
# settings
|
|
queue_mode = QUEUE_THREAD
|
|
queue_mode = QUEUE_THREAD
|
|
threshold_mode = THRESHOLD_FIXED
|
|
threshold_mode = THRESHOLD_FIXED
|
|
-should_index_empty = True
|
|
|
|
|
|
|
|
db_path = config.get('localDatabase', os.path.join(device_path, 'files.db'))
|
|
db_path = config.get('localDatabase', os.path.join(device_path, 'files.db'))
|
|
db = sqlite3.connect(db_path)
|
|
db = sqlite3.connect(db_path)
|
|
@@ -217,14 +216,11 @@ def process_segment(item, audios=None):
|
|
values.append(str(match['confidence']))
|
|
values.append(str(match['confidence']))
|
|
|
|
|
|
except KeyError as ex:
|
|
except KeyError as ex:
|
|
- if should_index_empty:
|
|
|
|
- results.append({
|
|
|
|
- 'confidence': 0,
|
|
|
|
- 'timestamp': ts,
|
|
|
|
- 'offset': match['offset']
|
|
|
|
- })
|
|
|
|
- else:
|
|
|
|
|
|
+ the_key = str(ex)
|
|
|
|
+ if the_key == 'confidence':
|
|
log.warning('Invalid confidence')
|
|
log.warning('Invalid confidence')
|
|
|
|
+ else:
|
|
|
|
+ log.warning(the_key)
|
|
|
|
|
|
ts += match['length'] / 1000
|
|
ts += match['length'] / 1000
|
|
|
|
|