Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental loading and filter system for local source #437

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

Shamicen
Copy link
Contributor

@Shamicen Shamicen commented Feb 21, 2024

Closes #365
Fixes #397

I implemented my old Tachiyomi PR in Mihon.

New features:

  • Local Source manga now load in chunks of 10 instead of having to wait for all Manga to load.
  • Manga now get loaded with Metadata applied.
  • Manga can now be filtered.

Caveats:

  • Filters can only be applied to manga that have already loaded.
  • Order By is only available once all manga have loaded.
  • Adding new Manga to Local Source requires an app restart. New Manga can be added without restarting the app.
  • To update the filters the user has to press the reset button.

Loading times could be significantly improved by using ParallelStreams but this may hurt general app performance on low power devices.

@AntsyLich
Copy link
Member

Can we have the local source items indexed separately similar to download index and use filesystem observer to detect changes (FileObserver for android).

@Shamicen
Copy link
Contributor Author

Shamicen commented Feb 25, 2024

I don't really understand what you mean by indexed separately. If this about adding new files to LocalSource while the app is running we could achieve that with a FileObserver and adding the new manga to the end of the list, but as far as i can see FileObserver needs to have file access and i don't think this is possible with Scoped Storage.

If you mean caching LocalSource manga so we do not have to read the ComicInfo files every time then that would probably not be worth it since the bulk of the loading time comes from the cover files I forgot since it was so long ago but we already use metadata saved in the db to avoid re-scanning when available. The problem with the current implementation is that updates to the ComicInfo file will not get reflected. I also added a lastModified value to SManga if we also implement that value in Manga as lastModifiedLocal for example and push it to the db then we can simply compare the values and only re-scan if they do not match.

@AntsyLich
Copy link
Member

Right forgot about SAF. Lemme think about this for a bit.

@Shamicen
Copy link
Contributor Author

Shamicen commented Feb 26, 2024

I now implemented logic, to only re-scan ComicInfo files if the manga directory was modified.

@Shamicen
Copy link
Contributor Author

I added support for adding new manga while the app is running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot search using tags on local source Make local sources load in chunks like other extensions/scources
2 participants