fix bytes vs str error in migrate5to6 script

This commit is contained in:
Lex Berezhny 2019-01-15 16:09:47 -05:00
parent 9f9ec692c7
commit 1dbb250413

View file

@ -186,10 +186,14 @@ def do_migration(db_dir):
(stream_hash, blob_hash, position, iv) (stream_hash, blob_hash, position, iv)
) )
download_dir = conf.settings.download_dir
if not isinstance(download_dir, bytes):
download_dir = download_dir.encode()
# insert the file # insert the file
transaction.execute( transaction.execute(
"insert or ignore into file values (?, ?, ?, ?, ?)", "insert or ignore into file values (?, ?, ?, ?, ?)",
(stream_hash, stream_name, hexlify(conf.settings.download_dir), (stream_hash, stream_name, hexlify(download_dir),
data_rate, status) data_rate, status)
) )