mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 13:35:18 +00:00
Merge remote-tracking branch 'origin/development' into development
This commit is contained in:
commit
cdf26c28c2
6 changed files with 15 additions and 8 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
0.9.4-beta.25
|
||||
0.9.4-beta.26
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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>')
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue