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

Only syncing book metadata #3

Open
ianepreston opened this issue Aug 23, 2024 · 8 comments
Open

Only syncing book metadata #3

ianepreston opened this issue Aug 23, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@ianepreston
Copy link

I'm not sure what I'm doing wrong here, I've highlighted several sections of a book and pointed the plugin at the folder with metadata.epub.lua for it, but instead of getting the highlights (which I can see in the lua file) I only get part of the description for the book synced into my notes. I can't attach the file but I've tried it on a couple books and had similar results. Any suggestions?

@isosphere
Copy link
Owner

isosphere commented Aug 23, 2024

of the top of my head, it sounds like you might be using a different metadata sidecar setting. this is what i'm using, and maybe i've baked it in as a requirement when making this extension:

koreader/koreader#10074

second thought: maybe there's a new incompatibility? my koreader is a bit old1. what version are you using?

Footnotes

  1. 2024.03.1

@isosphere isosphere added the bug Something isn't working label Aug 24, 2024
@ianepreston
Copy link
Author

Thanks for following up! I don't have the folder options displayed in that issue, maybe because I'm on a newer version. I did try and move the sidecars from with the books to ./docsettings since that seemed like the closest to your config and that didn't change anything. I'm on 2024-07 so maybe it's something in the format that changed? I can dump one of my metadata examples in as a comment if you'd like.

@Raukze
Copy link

Raukze commented Aug 30, 2024

I do have that issue as well. First it wouldn't even sync at all but after moving everything to ./docsettings the book title, author, description and language would sync but as @ianepreston already described the bookmarks are not showing up.

-- ./docsettings/mnt/onboard/Books/Digital Minimalism_ Living Better With Less Technology - Cal Newport.sdr/metadata.epub.lua
return {
    ["annotations"] = {
        [1] = {
            ["chapter"] = "5: Don’t Click “Like”",
            ["datetime"] = "2024-08-27 18:16:32",
            ["drawer"] = "lighten",
            ["page"] = "/body/DocFragment[13]/body/div/h3[6]/text().0",
            ["pageno"] = 204,
            ["pos0"] = "/body/DocFragment[13]/body/div/h3[6]/text().0",
            ["pos1"] = "/body/DocFragment[13]/body/div/h3[6]/text().40",
            ["text"] = "PRACTICE: HOLD CONVERSATION OFFICE HOURS",
        },
        [2] = {
            ["chapter"] = "5: Don’t Click “Like”",
            ["datetime"] = "2024-08-27 18:17:03",
            ["drawer"] = "lighten",
            ["page"] = "/body/DocFragment[13]/body/div/p[93]/text()[2].11",
            ["pageno"] = 206,
            ["pos0"] = "/body/DocFragment[13]/body/div/p[93]/text()[2].11",
            ["pos1"] = "/body/DocFragment[13]/body/div/p[93]/text()[2].315",
            ["text"] = "Put aside set times on set days during which you’re always available for conversation. Depending on where you are during this period, these conversations might be exclusively on the phone or could also include in-person meetings. Once these office hours are set, promote them to the people you care about",
        },
    },
    ["cache_file_path"] = "./cache/cr3cache/Digital_Mini-Newport.epub.7bc4843f.1.cr3",
    ["config_panel_index"] = 2,
    ["copt_b_page_margin"] = 18,
    ["copt_block_rendering_mode"] = 3,
    ["copt_cjk_width_scaling"] = 100,
    ["copt_embedded_css"] = 1,
    ["copt_embedded_fonts"] = 1,
    ["copt_font_base_weight"] = 0,
    ["copt_font_gamma"] = 15,
    ["copt_font_hinting"] = 2,
    ["copt_font_kerning"] = 3,
    ["copt_font_size"] = 24,
    ["copt_h_page_margins"] = {
        [1] = 20,
        [2] = 20,
    },
    ["copt_line_spacing"] = 100,
    ["copt_nightmode_images"] = 1,
    ["copt_render_dpi"] = 96,
    ["copt_rotation_mode"] = 0,
    ["copt_smooth_scaling"] = 0,
    ["copt_status_line"] = 1,
    ["copt_sync_t_b_page_margins"] = 1,
    ["copt_t_page_margin"] = 18,
    ["copt_view_mode"] = 0,
    ["copt_visible_pages"] = 1,
    ["copt_word_expansion"] = 0,
    ["copt_word_spacing"] = {
        [1] = 95,
        [2] = 75,
    },
    ["cre_dom_version"] = 20240114,
    ["css"] = "./data/epub.css",
    ["doc_pages"] = 382,
    ["doc_path"] = "/mnt/onboard/Books/Digital Minimalism_ Living Better With Less Technology - Cal Newport.epub",
    ["doc_props"] = {
        ["authors"] = "Cal Newport",
        ["description"] = "<p>Learn how to switch off and find calm - from the New York Times bestselling author of A World Without Email 'Digital Minimalism is the Marie Kondo of technology' Evening Standard***** Do you find yourself endlessly scrolling through social media or the news while your anxiety rises? Are you feeling frazzled after a long day of endless video calls? In this timely book, professor Cal Newport shows us how to pair back digital distractions and live a more meaningful life with less technology. By following a 'digital declutter' process, you'll learn to: · Rethink your relationship with social media · Prioritize 'high bandwidth' conversations over low quality text chains · Rediscover the pleasures of the offline world Take back control from your devices and find calm amongst the chaos with Digital Minimalism.*****'An eloquent, powerful and enjoyably practical guide to cutting back on screen time' The Times'An urgent call to action for anyone serious about being in command of their own life' Ryan Holiday'What a timely and useful book' Naomi Alderman, author of The Power</p>",
        ["identifiers"] = "isbn:9780241341155\
google:S4NbDwAAQBAJ\
calibre:1\
uuid:058090e6-a4bf-4455-b315-f438c8597645\
9780525536543",
        ["keywords"] = "Self-Help\
Personal Growth\
Success\
Business & Economics\
Workplace Culture\
Technology & Engineering\
Social Aspects\
Happiness\
Self-Esteem\
Psychology\
Psychopathology\
Addiction\
Motivational & Inspirational\
Motivational\
Personal Success\
Computers\
Computerized Home & Entertainment\
Science\
Philosophy & Social Aspects\
Mobile & Wireless Communications",
        ["language"] = "en",
        ["title"] = "Digital Minimalism: Living Better With Less Technology",
    },
    ["floating_punctuation"] = 0,
    ["font_face"] = "Noto Serif",
    ["font_family_fonts"] = {},
    ["handmade_flows_edit_enabled"] = true,
    ["handmade_flows_enabled"] = false,
    ["handmade_toc_edit_enabled"] = true,
    ["handmade_toc_enabled"] = false,
    ["hide_nonlinear_flows"] = false,
    ["highlight_drawer"] = "lighten",
    ["hyph_force_algorithmic"] = false,
    ["hyph_soft_hyphens_only"] = false,
    ["hyph_trust_soft_hyphens"] = false,
    ["hyphenation"] = true,
    ["inverse_reading_order"] = false,
    ["last_xpointer"] = "/body/DocFragment[14]/body/div/p[39]/text()[1].0",
    ["page_overlap_style"] = "dim",
    ["partial_md5_checksum"] = "b3eefd8fbc8f77c592c4b40e7caac57c",
    ["partial_rerendering"] = true,
    ["percent_finished"] = 0.6020942408377,
    ["preferred_dictionaries"] = {},
    ["readermenu_tab_index"] = 1,
    ["show_overlap_enable"] = false,
    ["stats"] = {
        ["authors"] = "Cal Newport",
        ["highlights"] = 20,
        ["language"] = "en",
        ["notes"] = 0,
        ["pages"] = 382,
        ["performance_in_pages"] = {},
        ["series"] = "N/A",
        ["title"] = "Digital Minimalism: Living Better With Less Technology",
    },
    ["summary"] = {
        ["modified"] = "2024-08-27",
        ["status"] = "reading",
    },
    ["text_lang"] = "en-US",
    ["text_lang_embedded_langs"] = true,
    ["toc_ticks_ignored_levels"] = {},
}

@isosphere
Copy link
Owner

That looks different, they've changed the structure slighty. The "bookmarks" key is now "annotations", and I don't see the "notes" key. Should be a minor thing to fix.

@Raukze do you have a "bookmarks_version" key in your metadata file? I've got one here that says 20200615. Perhaps I can have conditional code that checks for this key and parses differently depending on its value. That'll allow for some degree of backwards compatibility and detection of unsupported versions.

@Raukze
Copy link

Raukze commented Aug 30, 2024

No there isn't any version in my file.

@isosphere
Copy link
Owner

No there isn't any version in my file.

Damn. We have to target a specific version, and you probably can't downgrade your KOReader to be compatible since it won't read the metadata; and we won't be able to intelligently detect an incompatible metadata file.

Currently our known-good target version is 2024.03.1. I've edited our README to include that information.

@thelazyoxymoron
Copy link

Came across the same issue on a newer KOReader version.

@Raukze do you have a "bookmarks_version" key in your metadata file?

There's no bookmarks_version in the lua file, however I can see one cre_dom_version key there. Perhaps it's the same thing? Or even if it is not, can this be used to target newer versions?

["cre_dom_version"] = 20240114,

@isosphere
Copy link
Owner

["cre_dom_version"] = 20240114,

The latest metadata file I have with my older version (2024.03.01) has this same key and value. It does not appear to discriminate the overall structure 😢.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants