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

Add support for books on SD card #2

Open
harmtemolder opened this issue Dec 27, 2022 · 8 comments
Open

Add support for books on SD card #2

harmtemolder opened this issue Dec 27, 2022 · 8 comments
Assignees
Labels
enhancement New feature or request feature request Feature request of any sort to UI/dev/etc user feedback needed Something that can be used to get user feedback to do upvote/downvote for feature requests, etc

Comments

@harmtemolder
Copy link
Owner

(Copied from #9 on sourcehut.)

See MobileRead Forum: https://www.mobileread.com/forums/showpost.php?p=4223014&postcount=52

@harmtemolder harmtemolder added the enhancement New feature or request label Dec 27, 2022
@ScrambleTheRamble
Copy link

I'm not sure when this was introduced in KoReader but at least 2023.03 supports storing all metadata in the folder "koreader/docsettings/"

Supporting this might solve this for multiple devices

@elmodor
Copy link
Contributor

elmodor commented May 16, 2023

Having access to the koreader/ folder would also enable reading koreader/history.lua for proper sidecar_changed integration for multiple devices / wireless devices.

The question is:
How do we access the koreader/ folder?
Currently it seems that the only way to obtain files (at least for wireless connected devices) is through calibres driver. Using the function get_file which is also used to get the sidecars we can access this koreader/ folder if we know the relative path. For wireless connection this is the path relatively to the inbox folder.

I couldn't find any way to obtain that path through calibres driver.

So the only option that currently comes to my mind is a per device configuration where the user has to enter the path of the koreader/ folder manually for each device (and maybe for every connection type? wired vs wireless)(full path vs relative path?).

@elmodor
Copy link
Contributor

elmodor commented May 24, 2023

If you have some time I would love your input on this @harmtemolder

@harmtemolder
Copy link
Owner Author

harmtemolder commented May 25, 2023

I don't actually use an SD card with my e-reader, but it has a slot, so I'll go find one to test.

I also read your comments in koreader/koreader#10432 and how you got the get_file function to work with ../../koreader/history.lua. As you said, not very intuitive, but something we could try finding with a scan. (Does history.lua exist? Does koreader/history.lua exist? Does ../koreader/history.lua exist? Etc.) The only caveat would be if books are in a completely different corner of the file system.

@harmtemolder
Copy link
Owner Author

I don't see any specific mentions of storing metadata in history.lua in KOReader's release notes: https://github.com/koreader/koreader/releases

But I do see history.lua mentioned in commits as far back as 2016: https://github.com/search?q=repo%3Akoreader%2Fkoreader+%22history.lua%22&type=commits

Not that it really matters when this option was added to KOReader. I was just curious

@elmodor
Copy link
Contributor

elmodor commented May 25, 2023

The history.lua files contains this information. This is an example of its content:

return {
    [1] = {
        ["file"] = "/full/path/book.epub",
        ["time"] = 1681835840,
    },
}

Obtaining the koreader folder could hence solve two issues:

  • To obtain docsettings which can contain all sidecar's (if the option is enabled in koreader to store sidecar content in docsettings instead of next to the epub)
  • To obtain history.lua for a proper last_modified time for (at least) wireless devices

We could try finding it via a scan but the problem is that for wireless devices we would need to use get_file since (as far as I know) this is the only function that allows us to get access to a file on the connected device.
If it fails to find it, then we would need a per device configuration. But I think this would also be different for the connection type?

  • For wireless connected devices: the relative path from the inbox folder (it's the folder selected when you do a wireless connection).
  • For wired connected devices: I assume the full path since get_file will start at /?
    Plus this could be different on different OS systems. However, there we could possibly use python to search for this folder/files.

This might be the way but probably a very complex setup.

kyxap added a commit that referenced this issue Jul 27, 2024
…evices-as-html

Highlight/bookmark support for new devices in html format
@kyxap
Copy link
Collaborator

kyxap commented Jul 27, 2024

hey @elmodor @ScrambleTheRamble wanted to ask if this still needed? If so can you try it with latest release and let me know what you see on your end? https://github.com/harmtemolder/koreader-calibre-plugin/releases/tag/v0.6.3

@kyxap kyxap self-assigned this Jul 27, 2024
@kyxap kyxap added feature request Feature request of any sort to UI/dev/etc waiting for author answer Tag to use if there any information required for author user feedback needed Something that can be used to get user feedback to do upvote/downvote for feature requests, etc labels Jul 27, 2024
@kyxap
Copy link
Collaborator

kyxap commented Jul 27, 2024

please upvote author post if you want to see this in future releases with👍 or 👎

@kyxap kyxap removed the waiting for author answer Tag to use if there any information required for author label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request Feature request of any sort to UI/dev/etc user feedback needed Something that can be used to get user feedback to do upvote/downvote for feature requests, etc
Projects
None yet
Development

No branches or pull requests

4 participants