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

[FEATURE] Managing KOReader lua files #58

Open
shuvashish76 opened this issue Nov 12, 2024 · 5 comments
Open

[FEATURE] Managing KOReader lua files #58

shuvashish76 opened this issue Nov 12, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request feature request Feature request of any sort to UI/dev/etc help wanted Extra attention is needed

Comments

@shuvashish76
Copy link

shuvashish76 commented Nov 12, 2024

Feature Summary

Is it possible to backup the lua files

Motivation

I'm using Syncthing on both PC and mobile. I've created a folder on both pc and phone for ebooks which is sync through Syncthing. On Calibre I use "Connect to folder" feature, copy books there and it gets sync with phone.

The metadata.epub.lua, metadata.pdf.lua files are stored under respective folders on that ebook folder.

A Long text column to store the contents of the metadata sidecar as HTML, with Interpret this column as set to HTML.

As per the readme I've used this and it makes the backup but the contents are not exactly same

For example on lua files it's

{
    ["annotations"] = {
        [1] = {
            ["chapter"] = "Lesson 1.1: Living a Purpose-Focused Life",

But on Calibre I see them as

Normal view

{
"annotations": {
"1": {
"chapter": "Lesson 1.1: Living a Purpose-Focused Life",

HTML source

<div>
<p>{<br>"annotations": {<br>"1": {<br>"chapter": "Lesson 1.1: Living a Purpose-Focused Life",

Use Cases

Is it possible to convert them and save them as lua files incase I lose the folder on phone or PC.
Request for the possibility of this feature directly from the plug-in. Also possibility of moving that file to relevant folder for the respective ebooks. If no such folders exist create and move the file. If the file already exist then show warning to the user that it'll re-write the file which will lose existing data.

Alternatives

No response

Additional Context

No response

@shuvashish76 shuvashish76 added enhancement New feature or request triage needs attention labels Nov 12, 2024
@anaxonda
Copy link

anaxonda commented Dec 6, 2024

Not sure if this is quite what this request is asking, but would be useful to me to have a simple sidecar folder backup feature, from koreader to the calibre folder the book resides in.

@kyxap
Copy link
Collaborator

kyxap commented Dec 10, 2024

Yeah I think it's possible to save sidecar_lua file since currently plugin is doing lua parsing to extract data

@kyxap kyxap added help wanted Extra attention is needed feature request Feature request of any sort to UI/dev/etc and removed triage needs attention labels Dec 10, 2024
@wfdewith
Copy link

@shuvashish76 doesn't your use case work already? You can currently backup and restore the sidecar files through this plugin when you connect to the synced folder in Calibre. The plugin will take care of converting the JSON back to Lua files when you click "Sync missing to KOReader". The only thing missing is a force sync that will overwrite any existing sidecars.

@anaxonda just so I understand your request correctly.

The current Calibre library looks like this:

Library
└── Author Name
    └── Book Title (1)
        ├── Book Title - Author Name.epub
        ├── Book Title - Author Name.pdf
        ├── cover.jpg
        └── metadata.opf

and you want the following:

Library
└── Author Name
    └── Book Title (1)
        ├── Book Title - Author Name.epub
        ├── Book Title - Author Name.pdf
        ├── Book Title - Author Name.sdr
        │   ├── metadata.epub.lua
        │   └── metadata.pdf.lua
        ├── cover.jpg
        └── metadata.opf

Can I ask what the use case is here?

@harmtemolder
Copy link
Owner

@wfdewith I agree with what you're saying in #28 (comment): it would make sense to store the raw Lua in a separate column, which I believe is what this issue is about. And rewriting the Sync missing to KOReader function to use that raw Lua instead of the JSON

@anaxonda
Copy link

anaxonda commented Dec 12, 2024

Can I ask what the use case is here?

Yes that directory structure is what I was envisioning. Use case would be to be able to open any book from Calibre in Koreader, and have it load any annotations made on an ereader.

I've been finding that using Koreader instead of the built-in Calibre reader much faster.

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 help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants