mloader icon indicating copy to clipboard operation
mloader copied to clipboard

Sakamoto Days chapter 123 is mistakenly considered an oneshot

Open 10SecondsToWaste opened this issue 2 years ago • 3 comments

Steps to replicate

Install the develop branch, change AUTH_PARAMS, then run the following:

$ mloader --format raw --chapter 1017028
  • Actual name: Sakamoto Days - 000 (web) [Oneshot] [Unknown]
  • Expected name: Sakamoto Days - c123 (web) [Unknown]`

This chapter's name is "One shot". This is probably the cause.

Environment:

  • mloader version: 1.1.10@develop
  • Mangaplus URL: https://mangaplus.shueisha.co.jp/viewer/1017028

10SecondsToWaste avatar Jan 31 '24 14:01 10SecondsToWaste

https://github.com/hurlenko/mloader/blob/develop/mloader/utils.py needs to be updated to fix this issue 🤔

@10SecondsToWaste, Replace the is_oneshot definition with below code in utils.py:

def is_oneshot(chapter_name: str, chapter_subtitle: str) -> bool:
    chapnum = chapter_name_to_int(chapter_name)
    if chapnum:
        return False
    else:
        for name in (chapter_name, chapter_subtitle):
            name = name.lower()
            if "one" in name and "shot" in name:
                return True
    return False

I just tested this changed code and it works.

rokibhasansagar avatar Feb 07 '24 07:02 rokibhasansagar

@rokibhasansagar Thanks for investigating. Submitting a PR.

10SecondsToWaste avatar Feb 07 '24 13:02 10SecondsToWaste

Hmm, the PR #57 looks good. I used if..else conditional in my fix, but on second look, that was not necessary.

rokibhasansagar avatar Feb 07 '24 15:02 rokibhasansagar