diff --git a/VERSION b/VERSION index 0e094ca1f..188c9eb8e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.9.4-beta.25 +0.9.4-beta.26 diff --git a/bazarr/api.py b/bazarr/api.py index 0fb02d8af..8e7957064 100644 --- a/bazarr/api.py +++ b/bazarr/api.py @@ -377,14 +377,13 @@ class LanguagesProfiles(Resource): class Notifications(Resource): @authenticate def patch(self): - protocol = request.form.get("protocol") - path = request.form.get("path") + url = request.form.get("url") asset = apprise.AppriseAsset(async_mode=False) apobj = apprise.Apprise(asset=asset) - apobj.add(f"{protocol}://{path}") + apobj.add(url) apobj.notify( title='Bazarr test notification', diff --git a/bazarr/main.py b/bazarr/main.py index e16c8c113..bd23d6058 100644 --- a/bazarr/main.py +++ b/bazarr/main.py @@ -57,6 +57,9 @@ login_auth = settings.auth.type update_notifier() +@app.errorhandler(404) +def page_not_found(e): + return redirect(base_url, code=302) @app.route('/', defaults={'path': ''}) @app.route('/') diff --git a/frontend/src/Settings/Notifications/components.tsx b/frontend/src/Settings/Notifications/components.tsx index c924f4a8d..587ffdb24 100644 --- a/frontend/src/Settings/Notifications/components.tsx +++ b/frontend/src/Settings/Notifications/components.tsx @@ -84,7 +84,7 @@ const NotificationModal: FunctionComponent = ({ variant="outline-secondary" promise={() => { if (current && current.url) { - return SystemApi.testNotification(current.name, current.url); + return SystemApi.testNotification(current.url); } else { return null; } diff --git a/frontend/src/apis/system.ts b/frontend/src/apis/system.ts index 3dac5d126..bc0bb181c 100644 --- a/frontend/src/apis/system.ts +++ b/frontend/src/apis/system.ts @@ -137,9 +137,9 @@ class SystemApi extends BaseApi { }); } - async testNotification(protocol: string, path: string) { + async testNotification(url: string) { return new Promise((resolve, reject) => { - this.patch("/notifications", { protocol, path }) + this.patch("/notifications", { url }) .then(() => resolve()) .catch(reject); }); diff --git a/libs/subzero/modification/main.py b/libs/subzero/modification/main.py index da41e2e7d..b6131892e 100644 --- a/libs/subzero/modification/main.py +++ b/libs/subzero/modification/main.py @@ -275,8 +275,13 @@ class SubtitleModifications(object): logger.debug(u"Skipping empty line: %s", index) 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 - for line in t.split(r"\N"): + for line in line_split: # don't bother the mods with surrounding tags old_line = line line = line.strip()