oae / kaizoku

Self-hosted manga downloader
https://kaizoku.app
MIT License
530 stars 32 forks source link

Setting for clearing mangal cache at an interval #89

Open vodkapmp opened 1 year ago

vodkapmp commented 1 year ago

Feature Description

Mangal seems to sometimes need a cache clear for it to pick up new chapters. See Mangal issue: https://github.com/metafates/mangal/issues/161

Since Kaizoku is a downloader and doesn't really need the cache (since we're not browsing manga) it would make sense to have a setting that regularly clears this cache.

I've noticed that a good amount of my manga will stop getting updates because of this cache needing to be cleared. I have a cronjob that stops kaizoku and clears the /.cache/mangal/ folder, and the /tmp/rod/user-data/ (for mangasee) folders, and doing this has solved the issue for me.

After I noticed two mangas I knew had new chapters weren't downloading them, I deleted the cache folder, and over 20 of my mangas got multiple new chapters. I checked a random selection of these and all of them had new chapters that were 3+ weeks old. For multiple different sources (manganato, mangapill, and manganelo)

Solution you would like

A setting for kaizoku that will at x interval, or before every check for new chapters wipe out all files in /.cache/mangal/ and if mangasee /tmp/rod/user-data/

Alternatives you have considered

No response

Additional context

No response

oae commented 1 year ago

This is already implemented. You can check and then fix out-of-sync chapters. This will remove the cache also. I didn't want this to be run in intervals. Because sometimes, sources can delete old chapters.

image

vodkapmp commented 1 year ago

I have run a check for out of sync chapters multiple times since a lot of these chapters were out, so it must not clear it properly then. The one manga I was annoyed wasn't updated, had gotten 3 chapters the last two weeks, and I've ran at least two checks for out-of-sync chapters since that point. The last check just hours before I cleared the cache which solved the issue.

I did shut down the kaizoku, redis and postgresql dockers before deleting the cache, then restarted it afterwards. Maybe this restart was necessary for some reason?

Edit: Oh yeah, running mangal clear --cache did not solve the issue, so I'm pretty sure it is something getting stuck that even the clearing command doesn't get rid off, the folder had to be manually cleared out. If the out-of-sync check runs that command (which makes sense that it does) then that is probably why it didn't solve it

oae commented 1 year ago

I only delete JSON files under the mangal where -cache output except the anilist ones.

rzumbado commented 1 year ago

I have experienced the exact same issue, new chapters won't download. So clearing the cache (actually deleting the ~/.cache/mangal directory) fixed it for me.

Here are the steps I took: 1) Automated the deletion of ~/.cache/mangal directory every night at 12am 2) Automated the "update" of the Kaizoku docker container every night at 1am (docker compose pull, docker compose up) 3) profit.

I do have a server 24/7 so if you don't do it like that then just manually delete the cache folder often and restart the kaizoku app (docker or whatever) afterwards.

deviate116 commented 1 year ago

I am experiencing the same exact thing. Checking and fixing out of sync chapters didnt work for me. I followed what @rzumbado did and works for me.