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

This commit is contained in:
morpheus65535 2021-04-15 16:38:08 -04:00
commit cdf26c28c2
6 changed files with 15 additions and 8 deletions

View File

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

View File

@ -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',

View File

@ -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('/<path:path>')

View File

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

View File

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

View File

@ -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()