buggins / coolreader

Official site of CoolReader project. Sourceforge repository is obsolete.
GNU General Public License v2.0
374 stars 100 forks source link

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

Open mcepl opened 3 years ago

mcepl commented 3 years ago

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 commented 3 years ago

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

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

mcepl commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

No, it doesn't.

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

virxkane commented 3 years ago

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 commented 2 years ago

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

mcepl commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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

Why?

plotn commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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