From a20e570de1dcccc9c1be76accd37bb4906b22d66 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 15 Apr 2021 06:42:50 +0000 Subject: [PATCH 1/4] Release 0.9.4-beta.26 --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 56958488b6f90c04d35fb80872dfb88ae62e9e91 Mon Sep 17 00:00:00 2001 From: Vitiko <59455966+vitiko98@users.noreply.github.com> Date: Thu, 15 Apr 2021 07:47:30 -0400 Subject: [PATCH 2/4] Fixed big loop from subzero modification module Co-authored-by: vitiko98 --- libs/subzero/modification/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() From 385cc214b348815105bc654df3fc710b25a3e620 Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Fri, 16 Apr 2021 00:46:19 +0800 Subject: [PATCH 3/4] Fix issues when testing notifications --- bazarr/api.py | 5 ++--- frontend/src/Settings/Notifications/components.tsx | 2 +- frontend/src/apis/system.ts | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) 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/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); }); From c3c1891f5696cd261e560dceade92f23ab5b6652 Mon Sep 17 00:00:00 2001 From: LASER-Yi Date: Fri, 16 Apr 2021 01:19:23 +0800 Subject: [PATCH 4/4] Fix app route redirect issues --- bazarr/main.py | 3 +++ 1 file changed, 3 insertions(+) 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('/')