-
Notifications
You must be signed in to change notification settings - Fork 567
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
base: main
Are you sure you want to change the base?
Incremental loading and filter system for local source #437
Conversation
Can we have the local source items indexed separately similar to download index and use filesystem observer to detect changes (FileObserver for android). |
I don't really understand what you mean by indexed separately. If this about adding new files to
|
Right forgot about SAF. Lemme think about this for a bit. |
I now implemented logic, to only re-scan |
I added support for adding new manga while the app is running |
Cache local source entry metadata in the database. Reindex them on |
4890b1a
to
b6a53ec
Compare
I already do cache the metadata in the database
Why do you want to index them at that point? currently loading the metadata for an entire page (10 Manga) from the db takes around 0.017s. I do not think we gain anything from indexing them at app start. This would also lead to chunk sizes becoming irregular if a user removed or added manga to their local source directory.
Simply searching again won't help here. When the Local Source class is initialized, it loads all the directories (manga chunks) at that time. After all manga have been loaded once, I append any new directories that have been added to the Local Source directory since app launch to the manga chunks. If we remove this functionality, an app restart would be necessary to add new manga to Local Source.
I already do this it only reads the ComicInfo file from disk if the manga has not been cached yet or if it was modified. How about testing the current version once to compare the initial uncached load with subsequent cached loads? If it still loads to slow I can try to optimize it further. However, if I recall correctly, most of the remaining page load time was spent outside the functions I implemented. I also discovered a bug where opening Local Source throws an error if it is empty. I will investigate this issue over the coming weekend, and for now, I will convert this PR to a draft. |
Closes #365
Fixes #397
I implemented my old Tachiyomi PR in Mihon.
New features:
Caveats:
Adding new Manga to Local Source requires an app restart.New Manga can be added without restarting the app.Loading times could be significantly improved by using ParallelStreams but this may hurt general app performance on low power devices.