mirror of
https://github.com/morpheus65535/bazarr
synced 2025-02-28 16:45:40 +00:00
Fix for #1338
This commit is contained in:
parent
535dcd55a8
commit
38e55148d2
2 changed files with 6 additions and 5 deletions
|
@ -517,13 +517,14 @@ class SystemLogs(Resource):
|
||||||
with io.open(os.path.join(args.config_dir, 'log', 'bazarr.log'), encoding='UTF-8') as file:
|
with io.open(os.path.join(args.config_dir, 'log', 'bazarr.log'), encoding='UTF-8') as file:
|
||||||
for line in file.readlines():
|
for line in file.readlines():
|
||||||
lin = line.split('|')
|
lin = line.split('|')
|
||||||
log = dict()
|
|
||||||
log["timestamp"] = lin[0]
|
|
||||||
log["type"] = lin[1].rstrip()
|
|
||||||
log["message"] = lin[3]
|
|
||||||
if len(lin) > 4:
|
if len(lin) > 4:
|
||||||
|
log = dict()
|
||||||
|
log["timestamp"] = lin[0]
|
||||||
|
log["type"] = lin[1].rstrip()
|
||||||
|
log["message"] = lin[3]
|
||||||
if lin[4] != '\n':
|
if lin[4] != '\n':
|
||||||
log['exception'] = lin[4].strip('\'').replace(' ', '\u2003\u2003')
|
log['exception'] = lin[4].strip('\'').replace(' ', '\u2003\u2003')
|
||||||
|
|
||||||
logs.append(log)
|
logs.append(log)
|
||||||
logs.reverse()
|
logs.reverse()
|
||||||
return jsonify(data=logs)
|
return jsonify(data=logs)
|
||||||
|
|
|
@ -56,7 +56,7 @@ def guess_filename(filename, options):
|
||||||
print(yline)
|
print(yline)
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
print('GuessIt found:', json.dumps(guess, cls=GuessitEncoder, indent=4, ensure_ascii=False))
|
print('GuessIt found:', json.dumps(guess, cls=GuessitEncoder, ensure_ascii=False))
|
||||||
|
|
||||||
|
|
||||||
def display_properties(options):
|
def display_properties(options):
|
||||||
|
|
Loading…
Reference in a new issue