mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-08 01:01:26 +08:00
fix(http): use explicit success checks in async callers
This commit is contained in:
@@ -39,7 +39,7 @@ class BangumiApi(object):
|
||||
params.update(kwargs)
|
||||
resp = self._req.get_res(url=req_url, params=params)
|
||||
try:
|
||||
if not resp:
|
||||
if resp is None or resp.status_code != 200:
|
||||
return None
|
||||
result = resp.json()
|
||||
return result.get(key) if key else result
|
||||
@@ -55,7 +55,7 @@ class BangumiApi(object):
|
||||
params.update(kwargs)
|
||||
resp = await self._async_req.get_res(url=req_url, params=params)
|
||||
try:
|
||||
if not resp:
|
||||
if resp is None or resp.status_code != 200:
|
||||
return None
|
||||
result = resp.json()
|
||||
return result.get(key) if key else result
|
||||
|
||||
Reference in New Issue
Block a user