fix(Nextcloud): Use current notification app name, handle admin_notifications
- The first notification's app name was used (leftover from testing) instead of the current one. - `admin_notifications` now display properly
This commit is contained in:
parent
00ef0d7861
commit
e2808e4026
1 changed files with 5 additions and 1 deletions
6
main.py
6
main.py
|
@ -171,7 +171,11 @@ def main():
|
||||||
last_datetime = datetime.fromisoformat(notification["datetime"])
|
last_datetime = datetime.fromisoformat(notification["datetime"])
|
||||||
log.info("New notifications received.")
|
log.info("New notifications received.")
|
||||||
|
|
||||||
title = f"Nextcloud - {translate_app_name(data["ocs"]["data"][0]["app"])}: {data["ocs"]["data"][0]["subject"]}"
|
title = ""
|
||||||
|
if notification["app"] == "admin_notifications":
|
||||||
|
title = f"Nextcloud: {notification["subject"]}"
|
||||||
|
else:
|
||||||
|
title = f"Nextcloud - {translate_app_name(notification["app"])}: {notification["subject"]}"
|
||||||
log.debug(f"Notification title: {title}")
|
log.debug(f"Notification title: {title}")
|
||||||
|
|
||||||
message = notification["message"]
|
message = notification["message"]
|
||||||
|
|
Loading…
Reference in a new issue