C9Glax / tranga

Docker-Container to monitor (Manga) Scanlation-Sites for download new chapters.
GNU General Public License v3.0
152 stars 13 forks source link

Return latest chapternumber with Manga #74

Open C9Glax opened 1 year ago

C9Glax commented 1 year ago

https://github.com/C9Glax/tranga-website/pull/17#issuecomment-1782243644

db-2001 commented 1 year ago

Would it be possible to implement this feature by scanning the highest chapter number in the filename, rather than unzipping each file? Just an idea, not sure how it works. I think the current untested version would just return the latest downloaded chapter on disk which isn't necessarily the highest downloaded chapter.

C9Glax commented 1 year ago

latestChapterDownloaded = latestChapterDownloaded < chapterNumber ? chapterNumber : latestChapterDownloaded; makes sure it's the newest.

The problem with parsing filenames after the fact, is that the regex could mess up, should there be numbers in the title. Unzipping and parsing from the ComicInfo.xml would give a 100% accurate result.

db-2001 commented 1 year ago

So if I understand correctly, this line of code is already in the API and should return the latestChapterDownloaded whenever a new chapter is downloaded, so Mangas added after the implementation should have this field be non-zero if they've had a chapter downloaded after then? Also it should work, in theory, when searching for a Manga? I ask because currently my version of the API (which isn't latest but does have these fields) is reporting all values as 0