01-27-2023, 10:41 AM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2023
Device: PocketBook
|
Editing metadata - why is this so...? - content.opf
file - content.opf
Editing the metadata gets this result: <meta name="calibre:series" content="YOUR SERIES"/> Press File/Save changes: <meta content="YOUR SERIES" name="calibre:series" /> Is it possible that these changes will not happen? |
01-27-2023, 11:01 AM | #2 |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Attribute orders are unimportant. But... I'm fairly certain that Sigil was updated to retain attribute orders some time ago. Are you using an up to date version of Sigil? If not, there's not much that can be done.
|
Advert | |
|
01-27-2023, 11:41 AM | #3 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2023
Device: PocketBook
|
Quote:
With this option, the attributes are not shown in the programs. on devices Iphone and pocketbook. If you hand-correct on the <meta name="calibre:series" content="YOUR SERIES"/> shows. The question is why: you change one thing, you save it, it changes. Why? |
|
01-27-2023, 11:50 AM | #4 | |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
We will look into whether or not we can preserve that attribute order, but we're not going to put ourselves on the hook for making changes just to fix broken apps that don't follow spec. Last edited by DiapDealer; 01-27-2023 at 11:54 AM. |
|
01-27-2023, 12:20 PM | #5 | ||
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2023
Device: PocketBook
|
Quote:
Looked here https://idpf.org/epub/20/spec/OPF_2....htm#Section2.3 Quote:
<meta name="calibre:series" content="YOUR SERIES"/> Can be made optional, at the user's choice. |
||
Advert | |
|
01-27-2023, 12:43 PM | #6 | ||
Grand Sorcerer
Posts: 6,670
Karma: 86234809
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Quote:
Quote:
|
||
01-27-2023, 12:50 PM | #7 | |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I said we'd look into accommodating these broken programs (if we can do so easily). Don't hurt your chances of this happening by mistakenly defending your position that it's Sigil that's misbehaving here. I can assure you that it's not. Nothing in the spec you quoted supports your position. |
|
01-27-2023, 12:59 PM | #8 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Jan 2023
Device: PocketBook
|
Quote:
|
|
01-27-2023, 01:45 PM | #9 |
Sigil Developer
Posts: 8,090
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Sigil changed to maintaining attribute order a while back even though the spec clearly says attribute order is not relevant. This one done to make the Checkpoint diff tool more effective. So I need help to track down which code inside Sigil is involved.
So some questions: 1. Are you hand editing the opf when editing the metadata or are you using the MetaData editor icon/menu? 2. If the opf is open in a tab can you confirm the order is correct before. 3. If an epub3, Before hitting file save can you use the Update Manifest properties (under epub3 tools) then take a look at the metadata order in the OPF tab. If epub2, use Add Sematics to change something in the opf guide, and see if the OPF tab changed. 4. Are you using an external Python with Sigil and if so what version as the Ordered dict in python was not the default in sime early versions and python is used by the metadata editing code? Last edited by KevinH; 01-27-2023 at 01:47 PM. |
01-27-2023, 01:53 PM | #10 |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I can confirm that it happens when editing the opf file manually. I don't even have to do a file/save. Just clicking on a file in the Book Browser makes the opf change from the inserted:
Code:
<meta name="calibre:series" content="YOUR SERIES"/> Code:
<meta content="YOUR SERIES" name="calibre:series"/> This being on Windows 10 with Sigil 1.9.20 Last edited by DiapDealer; 01-27-2023 at 01:55 PM. |
01-27-2023, 02:02 PM | #11 |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Clicking on any menu item in Sigil also immediately causes the opf entry to change. With both EPUB3 and EPUB2.
|
01-27-2023, 02:09 PM | #12 |
Sigil Developer
Posts: 8,090
Karma: 5450184
Join Date: Nov 2009
Device: many
|
So something is wrong with the OPF parsing code. It uses TagAtts.h which is definitely ordered. Probably something in inside the BS4 lxml repair parser which is invoked.
I will try to add a bunch of opf debug code to try to see where this is happening. Hopefully not deep inside lxml. |
01-27-2023, 02:13 PM | #13 |
Grand Sorcerer
Posts: 5,635
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
IMHO, this is a non-issue.
Spoiler:
|
01-27-2023, 02:24 PM | #14 | |
Grand Sorcerer
Posts: 27,881
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
So we'd probably be looking at this even if it had nothing to do with calibre series metadata. The fact that it affects some broken reading systems is secondary here. Even though metadata order should be irrelevant, we made a decision that Sigil should maintain attribute order as entered. This runs afoul of that. Last edited by DiapDealer; 01-27-2023 at 02:27 PM. |
|
01-27-2023, 02:27 PM | #15 |
Sigil Developer
Posts: 8,090
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Okay, I tracked this down to running the CleanSource::ProcessXML() routine which is done every time the OPF is loaded (and on any other xml files) to make sure they are sane and parseable. A broken OPF is not something anyone wants to happen.
Of course this damn code uses python and lxml deep inside of our bs4 code. So I will have to see where something misses the change to OrderedDict() which was made in all python code we use. I am on it. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Update CONTENT.OPF. Use metadata fr calibreDB | GOROW | Library Management | 1 | 04-13-2021 11:57 AM |
Problem with different metadata editing in opf | homura_no_ko | Library Management | 3 | 03-10-2018 07:26 PM |
Calibre changing metadata in content.opf? | ChipSuey | Editor | 2 | 08-09-2016 02:16 PM |
Editing content.opf with clips; Editing visibility | varlog | Sigil | 45 | 04-24-2016 07:55 AM |
Order of metadata in content.opf | SIRSteiner | Library Management | 4 | 10-08-2013 06:11 PM |