mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2025-02-16 22:08:25 +00:00
[19] fix run_end webhooks
This commit is contained in:
parent
f16710e3c7
commit
afc3064a82
2 changed files with 38 additions and 37 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.19.0-develop18
|
||||
1.19.0-develop19
|
||||
|
|
|
@ -36,7 +36,6 @@ class Webhooks:
|
|||
elif webhook.startswith("https://hooks.slack.com/services"):
|
||||
json = self.slack(json)
|
||||
response = self.config.post(webhook, json=json)
|
||||
if response:
|
||||
try:
|
||||
response_json = response.json()
|
||||
logger.trace(f"Response: {response_json}")
|
||||
|
@ -245,7 +244,11 @@ class Webhooks:
|
|||
rows = [
|
||||
[("Start Time", json["start_time"]), ("End Time", json["end_time"]), ("Run Time", json["run_time"])],
|
||||
[("Collections", None)],
|
||||
[("Created", json["collections_created"]), ("Modified", json["collections_modified"]), ("Deleted", json["collections_deleted"])]
|
||||
[
|
||||
("Created", json["collections_created"] if json["collections_created"] else "0"),
|
||||
("Modified", json["collections_modified"] if json["collections_modified"] else "0"),
|
||||
("Deleted", json["collections_deleted"] if json["collections_deleted"] else "0")
|
||||
]
|
||||
]
|
||||
if json["added_to_radarr"]:
|
||||
rows.append([(f"{json['added_to_radarr']} Movies Added To Radarr", None)])
|
||||
|
@ -316,9 +319,7 @@ class Webhooks:
|
|||
for row in rows:
|
||||
for col in row:
|
||||
col_name, col_value = col
|
||||
field = {"name": col_name}
|
||||
if col_value:
|
||||
field["value"] = col_value
|
||||
field = {"name": col_name, "value": col_value if col_value else ""}
|
||||
if len(row) > 1:
|
||||
field["inline"] = True
|
||||
fields.append(field)
|
||||
|
|
Loading…
Add table
Reference in a new issue