[26] better mdblist error

This commit is contained in:
meisnate12 2022-03-23 12:06:00 -04:00
parent e05db11b02
commit 9a1a1adf33
4 changed files with 9 additions and 4 deletions

BIN
.github/git.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

@ -17,11 +17,12 @@ jobs:
with:
webhook_id: ${{ secrets.BUILD_WEBHOOK_ID }}
webhook_token: ${{ secrets.BUILD_WEBHOOK_TOKEN }}
title: Plex Meta Manager Nightly Commits
title: Nightly Commits
commits: "true"
username: Metabot
avatar_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/nightly/.github/pmm.png
author: Github Nightly
author: Github
author_icon_url: https://raw.githubusercontent.com/meisnate12/Plex-Meta-Manager/nightly/.github/git.png
- name: Check Out Repo
uses: actions/checkout@v3

View file

@ -1 +1 @@
1.16.2-develop25
1.16.2-develop26

View file

@ -1,4 +1,5 @@
from datetime import datetime
from json import JSONDecodeError
from modules import util
from modules.util import Failed
from urllib.parse import urlparse
@ -171,6 +172,9 @@ class Mdblist:
url_base = parsed_url._replace(query=None).geturl()
url_base = url_base if url_base.endswith("/") else f"{url_base}/"
url_base = url_base if url_base.endswith("json/") else f"{url_base}json/"
return [(i["imdb_id"], "imdb") for i in self.config.get_json(url_base, headers=headers, params=params)]
try:
return [(i["imdb_id"], "imdb") for i in self.config.get_json(url_base, headers=headers, params=params)]
except JSONDecodeError:
raise Failed(f"Mdblist Error: Invalid Response")
else:
raise Failed(f"Mdblist Error: Method {method} not supported")