Merge remote-tracking branch 'origin/development' into development

pull/1383/head
morpheus65535 4 years ago
commit cdf26c28c2

@ -1 +1 @@
0.9.4-beta.25 0.9.4-beta.26

@ -377,14 +377,13 @@ class LanguagesProfiles(Resource):
class Notifications(Resource): class Notifications(Resource):
@authenticate @authenticate
def patch(self): def patch(self):
protocol = request.form.get("protocol") url = request.form.get("url")
path = request.form.get("path")
asset = apprise.AppriseAsset(async_mode=False) asset = apprise.AppriseAsset(async_mode=False)
apobj = apprise.Apprise(asset=asset) apobj = apprise.Apprise(asset=asset)
apobj.add(f"{protocol}://{path}") apobj.add(url)
apobj.notify( apobj.notify(
title='Bazarr test notification', title='Bazarr test notification',

@ -57,6 +57,9 @@ login_auth = settings.auth.type
update_notifier() update_notifier()
@app.errorhandler(404)
def page_not_found(e):
return redirect(base_url, code=302)
@app.route('/', defaults={'path': ''}) @app.route('/', defaults={'path': ''})
@app.route('/<path:path>') @app.route('/<path:path>')

@ -84,7 +84,7 @@ const NotificationModal: FunctionComponent<ModalProps & BaseModalProps> = ({
variant="outline-secondary" variant="outline-secondary"
promise={() => { promise={() => {
if (current && current.url) { if (current && current.url) {
return SystemApi.testNotification(current.name, current.url); return SystemApi.testNotification(current.url);
} else { } else {
return null; return null;
} }

@ -137,9 +137,9 @@ class SystemApi extends BaseApi {
}); });
} }
async testNotification(protocol: string, path: string) { async testNotification(url: string) {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
this.patch<void>("/notifications", { protocol, path }) this.patch<void>("/notifications", { url })
.then(() => resolve()) .then(() => resolve())
.catch(reject); .catch(reject);
}); });

@ -275,8 +275,13 @@ class SubtitleModifications(object):
logger.debug(u"Skipping empty line: %s", index) logger.debug(u"Skipping empty line: %s", index)
continue continue
line_split = t.split(r"\N")
if len(line_split) > 3: # Badly parsed subtitle
logger.error("Skipping %d lines for %s mod", len(line_split), mods)
continue
skip_entry = False skip_entry = False
for line in t.split(r"\N"): for line in line_split:
# don't bother the mods with surrounding tags # don't bother the mods with surrounding tags
old_line = line old_line = line
line = line.strip() line = line.strip()

Loading…
Cancel
Save