~nhanb/pytaku

a1eb24c6240711d5e7a7a08923fce331799b4a11 — Nhân 4 months ago c5616f7 master
cope with letters in chapters

Mangadex started having chapter numbers like `5c`.
2 files changed, 5 insertions(+), 5 deletions(-)

M src/mangoapi/mangadex.py
M src/pytaku/scheduler.py
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 (