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

Android: fake results in search (no cleanup of database on moving of files around) #313

Open
mcepl opened this issue Sep 16, 2021 · 12 comments

Comments

@mcepl
Copy link

mcepl commented Sep 16, 2021

Screenshot_20210916-142640

Happens to me all the time: when searching I get some results twice (although the file is in the filesystem only once) and one of the results (first in this case) just returns CoolReader to reading whatever I was reading before. Any ideas?

Using CoolReader from F-Droid.

@virxkane
Copy link
Collaborator

CoolReader looks in the database, not the filesystem.
Most likely, you have orphan records in your database instance:

  • it was possible to move book files from one folder to another;
  • or earlier there really were 2 copies of the file, then you deleted one, but the record remained in the database;
  • in addition, it is possible that there are indeed several identical files on the device, in a place that you may not even imagine, for example, in the application private directory;
  • more reasons, which I don't even presume...

Perhaps someday we will implement a neat cleaning of the database from such misunderstandings :)

@mcepl
Copy link
Author

mcepl commented Sep 16, 2021

I would think that “Search for books in the folder” (or how it is called in English, this is my back-translation from Czech) would do the database cleanup, doesn't it?

And yes, I do a lot of moving of EPub files among folders. Mostly I put all new files into tmp/ folder, and when I finish reading it, I move it to some appropriate archiving folder.

@virxkane
Copy link
Collaborator

I would think that “Search for books in the folder” (or how it is called in English, this is my back-translation from Czech) would do the database cleanup, doesn't it?

No, it doesn't.

@mcepl
Copy link
Author

mcepl commented Sep 17, 2021

No, it doesn't.

OK, I'll bite. Why it doesn't?

@virxkane
Copy link
Collaborator

OK, I'll bite. Why it doesn't?

Well, because nobody did. I think no one will mind if you implement a neat cleanup of the database and do a PR :)

@mcepl mcepl changed the title Android: fake results in search Android: fake results in search (no cleanup of database on moving of files around) Sep 17, 2021
@mcepl
Copy link
Author

mcepl commented Sep 17, 2021

Sorry, you don't want me to write a large C code.

@mcepl
Copy link
Author

mcepl commented Dec 16, 2021

Where is that database stored. I tried to clean up applications storage space and cache, but that isn’t it, right? Fake results are still present.

@plotn
Copy link
Contributor

plotn commented Mar 8, 2022

@mcepl, it was implemented in my fork, you could investigate from here (search for "maintenance", "orphan"):
https://github.com/plotn/coolreader/blob/master/android/src/org/coolreader/crengine/ScanLibraryDialog.java
Unfortunally I do not plan to make a PR into upstream, but one could adopt it, if he want.

@mcepl
Copy link
Author

mcepl commented Mar 8, 2022

Unfortunally I do not plan to make a PR into upstream, but one could adopt it, if he want.

Why?

@plotn
Copy link
Contributor

plotn commented Mar 9, 2022

Why?

The codebase became significially different, it is hard manual work. On the other hand - upstream development actually stopped, so this makes no sense, as I guess.

@mcepl
Copy link
Author

mcepl commented Mar 9, 2022

The codebase became significially different, it is hard manual work. On the other hand - upstream development actually stopped, so this makes no sense, as I guess.

So, why won’t you publish it as a fork and provide binaries on F-Droid?

@plotn
Copy link
Contributor

plotn commented Mar 9, 2022

@mcepl , this work in progress.
anyway, you could get my binaries if you want from 4pda theme - e.g. https://4pda.to/forum/index.php?s=&showtopic=995536&view=findpost&p=113572389

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

No branches or pull requests

3 participants