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

Do not override the existing history #26

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

Conversation

Hzj-jie
Copy link
Contributor

@Hzj-jie Hzj-jie commented Oct 17, 2024

For #25, @mergen3107 would you mind take a shot if it works for your scenario?

You may just copy the file https://raw.githubusercontent.com/koreader/contrib/0413b13de4cde84a46be177e8b5c492c7123ec11/findhistory.koplugin/main.lua to replace the existing one in the plugin folder and restart the koreader.

Highly suggest backing up history before hand in case anything goes wrong.

This change is Reviewable

@mergen3107
Copy link

Hi @Hzj-jie
Thanks for looking into this!

I tried the new main.lua file.
It worked fine, but it created duplicates in history.
One of the the duplicated books somehow did not have cover (just triple dots) nor title/description upon long-press (empty). KOReader crashed after I tapped on it:

./luajit: frontend/apps/reader/readerui.lua:607: bad argument #1 to 'attributes' (string expected, got nil)
stack traceback:
	[C]: in function 'attributes'
	frontend/apps/reader/readerui.lua:607: in function 'showReader'
	frontend/apps/reader/readerui.lua:882: in function 'switchDocument'
	frontend/apps/filemanager/filemanagerhistory.lua:129: in function 'onMenuChoice'
	frontend/ui/widget/menu.lua:1339: in function 'onMenuSelect'
	plugins/coverbrowser.koplugin/mosaicmenu.lua:851: in function 'handleEvent'
	frontend/ui/widget/container/inputcontainer.lua:266: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	...
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent'
	frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent'
	frontend/ui/uimanager.lua:911: in function 'sendEvent'
	frontend/ui/uimanager.lua:53: in function '__default__'
	frontend/ui/uimanager.lua:1438: in function 'handleInputEvent'
	frontend/ui/uimanager.lua:1538: in function 'handleInput'
	frontend/ui/uimanager.lua:1582: in function 'run'
	./reader.lua:265: in main chunk
	[C]: at 0x00013ead
lipc-wait-event exited normally with status: 0

After next restart, I was able to see that this was a duplicate, and it opens by tapping on either of the copy (but only one gets updates in History with a timestamp, the other stay in the same place, but still works).

I'll revert to my backup history for now.

@Hzj-jie
Copy link
Contributor Author

Hzj-jie commented Oct 17, 2024

Thank you for the test, it looks more than I thought. I haven't touched the code in koreader for a while, likely something got changed. I will take a deeper look.

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.

2 participants