Carleslc/InMangaKindle

Fails when cache

Dnllns opened this issue · 2 comments

Ok, there is an error on cap 493, but im not targeting it

python3 manga.py naruto --chapters 390..399 --format MOBI --rotate --single --cache

Searching naruto...
Converting to MOBI...
Naruto 390-399
Preparing source images...
Checking images...
Image file ./manga/Naruto/493/20.png is corrupted. Error: cannot identify image file '/tmp/KCC-1z339j1x/OEBPS/Images/493/20.png'

Thank you for pointing this error out. No chapter filtering was being performed with --single option for other formats than PDF, so all downloaded chapters in local manga directory are merged into the resulting MOBI file, which of course was not your intended behaviour providing the --chapters option for filtering. I've just fixed this problem so filtering with --single and --cache behaves as it should.

In addition, I've changed the behaviour of --cache to be fully offline. Until now, though it was not downloading anything new, it was connecting to the provider to resolve the search query. Now resolves locally using currently downloaded manga, improving performance.

About image error it seems that provider's file is broken (Naruto 493/20). The fix to convert that chapter is to remove the corrupted image manually from ./manga/Naruto/493/20.png and then run python3 manga.py naruto --chapter 493 --format MOBI --rotate --single --cache. However, for better usability and fault tolerance, I've added an autofix from code so if you run that command now it will remove the corrupted image and finish the conversion without any error.

Hope it works for you as well for others.

The new version can be pulled using git or from the release page.

Thank you ;)