Skip to content

Commit

Permalink
Fixes issue in "Mark as watched/unwatched" logic. (#226)
Browse files Browse the repository at this point in the history
* Fixes issue in "Mark as watched/unwatched" logic.

Co-authored-by: Dmitry Mostovoy <[email protected]>
  • Loading branch information
stavultras and Dmitry Mostovoy authored Aug 31, 2022
1 parent fcfcad9 commit e574f82
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/resources/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ def _make_request(self, request, timeout=600):
self.plugin.logger.error(f"{type(e).__name__}. Message: {e.message}")
notice(e.message, "Ошибка")
else:
http_code = response.status
response = json.loads(response.read())
if response["status"] == 200:

if response and response["status"] == 200:
return response
elif http_code == 200:
return {"status": 200}
else:
self.plugin.logger.error(f"Unknown error. Code: {response['status']}")
notice(f"Код ответа сервера {response['status']}", "Ошибка")
Expand Down

0 comments on commit e574f82

Please sign in to comment.