Add issue reporting
This commit is contained in:
parent
0ab4f860b7
commit
b22f802e3b
2 changed files with 6 additions and 3 deletions
4
app.py
4
app.py
|
@ -68,11 +68,10 @@ def overseerr_api():
|
|||
media_type = media['media_type']
|
||||
|
||||
show_data = None
|
||||
show_id = int(media["tmdbId"])
|
||||
if media_type == "tv":
|
||||
show_id = int(media["tmdbId"])
|
||||
show_data = overseerr.get_tv_show(show_id)
|
||||
elif media_type == "movie":
|
||||
show_id = int(media["tmdbId"])
|
||||
show_data = overseerr.get_movie(show_id)
|
||||
|
||||
if show_data:
|
||||
|
@ -84,6 +83,7 @@ def overseerr_api():
|
|||
print(f"Request declined, \"{data['subject']}\" is available for streaming on the following providers:")
|
||||
for provider in providers.values():
|
||||
print(f"\t{provider}")
|
||||
overseerr.create_issue(f"Request for \"{data['subject']}\" declined", show_id)
|
||||
else:
|
||||
print(f"Request for \"{data['subject']}\" approved.")
|
||||
overseerr.update_request_status(int(media_request["request_id"]), "approve")
|
||||
|
|
|
@ -37,3 +37,6 @@ class Overseerr(object):
|
|||
|
||||
def update_request_status(self, req_id: int, status: Union["approve", "decline"]):
|
||||
return self._post(f"/request/{req_id}/{status}").json()
|
||||
|
||||
def create_issue(self, message, media_id):
|
||||
return self._post(f"/issue", params={"issueType":0, "message":message, "mediaId":media_id}).json()
|
Loading…
Reference in a new issue