M src/mangoapi/mangadex.py => src/mangoapi/mangadex.py +2 -2
@@ 188,7 188,7 @@ def _parse_chapter_number(string):
count = len(nums)
assert count == 1 or count == 2
result = {"number": string}
- result["num_major"] = int(nums[0])
+ result["num_major"] = nums[0]
if count == 2:
- result["num_minor"] = int(nums[1])
+ result["num_minor"] = nums[1]
return result
M src/pytaku/scheduler.py => src/pytaku/scheduler.py +3 -3
@@ 5,9 5,8 @@ from datetime import datetime, timedelta
from json.decoder import JSONDecodeError
from pathlib import Path
-from requests.exceptions import ReadTimeout
-
from mangoapi.exceptions import SourceSite5xxError, SourceSite404Error
+from requests.exceptions import ReadTimeout
from .conf import config
from .persistence import delete_expired_tokens, find_outdated_titles, save_title
@@ 74,7 73,8 @@ class UpdateOutdatedTitles(Worker):
try:
updated_title = get_title(title["site"], title["id"])
save_title(updated_title)
- print(f" done ({updated_title['chapters'][0]['number']})")
+ chapters = updated_title["chapters"]
+ print(f" done ({chapters and chapters[0]['number']})")
if title["site"] == "mangasee":
time.sleep(2)
except (