aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcli.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli.py b/cli.py
index 085a0bc..921ecf5 100755
--- a/cli.py
+++ b/cli.py
@@ -90,10 +90,12 @@ def load_biblehub(db, f):
'VALUES (?, ?, ?)', (v['book'], v['chapter'], v['verse']))
for translation, text in v['translations'].items():
- conn.execute('INSERT OR IGNORE INTO translated_verses '
- '(translation, book, chapter, nr, text) '
- 'VALUES (?, ?, ?, ?, ?)',
- (translation, cur_book, v['chapter'], v['verse'], text))
+ text = text.strip()
+ if text != '':
+ conn.execute('INSERT OR IGNORE INTO translated_verses '
+ '(translation, book, chapter, nr, text) '
+ 'VALUES (?, ?, ?, ?, ?)',
+ (translation, cur_book, v['chapter'], v['verse'], text))
click.echo(str(round(time.time() - timer, 3)) + 's')
db.commit()