Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2025, 07:52 AM   #1
beedaddy
Addict
beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.
 
Posts: 202
Karma: 135428
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Libra 2 & Clara 2E, Tolino shine 5th Gen, Kindle PW6
EPUBs from calibre and calibre-server differ

I noticed that the exported EPUB from calibre and the downloaded EPUB from calibre-server differ. It's always content.opf that differ, maybe because calibre (desktop) always updates that part during export and calibre-server doesn't?

I would like to know whether it is possible to get identical results (which would be good for koreader sync of reading positions).
beedaddy is offline   Reply With Quote
Old 01-10-2025, 08:27 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-server also updates metadata when exporting. What exactly is the difference use the calibre diff tool to check.
kovidgoyal is online now   Reply With Quote
Old 01-10-2025, 08:46 AM   #3
beedaddy
Addict
beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.
 
Posts: 202
Karma: 135428
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Libra 2 & Clara 2E, Tolino shine 5th Gen, Kindle PW6
I depends. Sometimes it's just the different position (line) in the content.opf. In that case, I did a "update metadata in the book files" beforehand. And sometimes one differs in rec_index or still contains (deleted) custom column data. I've attached two diff-screenshots.
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto_20250110_130504.png
Views:	126
Size:	361.0 KB
ID:	212986   Click image for larger version

Name:	Bildschirmfoto_20250110_144245.png
Views:	116
Size:	224.4 KB
ID:	212987  
beedaddy is offline   Reply With Quote
Old 01-10-2025, 09:02 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's just some lines changing position not an actual difference. For the second screenshot, custom column metadata is deleted presumably because the EPUB is now in a library without that cusotm column.
kovidgoyal is online now   Reply With Quote
Old 01-10-2025, 10:01 AM   #5
beedaddy
Addict
beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.
 
Posts: 202
Karma: 135428
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Libra 2 & Clara 2E, Tolino shine 5th Gen, Kindle PW6
During testing, I accidentially deactivated "update metadata in saved copies". So here's an update of the second screenshot (book).
Attached Thumbnails
Click image for larger version

Name:	Bildschirmfoto_20250110_155031.png
Views:	106
Size:	349.2 KB
ID:	212993  
beedaddy is offline   Reply With Quote
Old 01-10-2025, 10:04 AM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,680
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by beedaddy View Post
During testing, I accidentially deactivated "update metadata in saved copies". So here's an update of the second screenshot (book).
I don't have Save to disk update the metadata. I prefer to have clean copies.
JSWolf is offline   Reply With Quote
Old 01-10-2025, 10:04 AM   #7
beedaddy
Addict
beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.
 
Posts: 202
Karma: 135428
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Libra 2 & Clara 2E, Tolino shine 5th Gen, Kindle PW6
Quote:
Originally Posted by beedaddy
During testing, I accidentially deactivated "update metadata in saved copies". So here's an update of the second screenshot (book).
If both would behave identically, i.e. both files would have the same md5 hash, it would simplify things for the KOReader. Synchronization of the reading position, for example, if the book on device A comes from calibre-server and on device B from calibre (desktop).
beedaddy is offline   Reply With Quote
Old 01-10-2025, 10:16 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Both use the exact same code to update metadata, so I don't see how they could possibly behave differently. Most likely updating metadata will shuffle some lines around since it works by first deleting metadata entries to reset and then creating them. Trying to make the updates in place or avoid the deletes completely is way too much work for me, patches welcome. KOReader really should be hashing only the spine and the actual content files, not the entire epub. Indeed simply unpacking and repacking an epub can yield a file with a different hash, but identical actual contents. This is because EPUB is a zip container and zip stores unused per file metadata such as timestamps. File has is absolutely the wrong way to be checking for file equality with EPUB.
kovidgoyal is online now   Reply With Quote
Old 01-10-2025, 12:56 PM   #9
beedaddy
Addict
beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.beedaddy has rectified all his or her action issues with transformational deconfliction.
 
Posts: 202
Karma: 135428
Join Date: Oct 2011
Location: Germany (south-west)
Device: Kobo Libra 2 & Clara 2E, Tolino shine 5th Gen, Kindle PW6
I understand your point about the hashes and absolutely agree. But if I export the book 10x with Calibre (desktop), I get the same file (same hash A) each time. And if I download it 10 times via Calibre (server), I also get the slightly different file 10 times identically (same hash B). Hence my assumption that something is different after all.

(Regarding KOReader, I could use not the binary based hash but filename based hash. But then the hassle starts to get them equal, and I can't configure the calibre-server "offered" filename at all.)
beedaddy is offline   Reply With Quote
Old 01-10-2025, 06:17 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Like I said they both use the exact same code, indeed updating metadata in EPUB files is implemented in only one place in all of calibre. You are likely seeing changes becuase of metadata update itself not being byte identical even when nothing is actually changed.
kovidgoyal is online now   Reply With Quote
Old 01-10-2025, 06:21 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,974
Karma: 168961900
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Perhaps Polish or ModifyEpub could be used to update the metadata in the library copy so the copy being sent does not need to be updated?
DNSB is offline   Reply With Quote
Old 01-10-2025, 06:24 PM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by DNSB View Post
Perhaps Polish or ModifyEpub could be used to update the metadata in the library copy so the copy being sent does not need to be updated?
The problem is the update happens regardless. And updating will change the file in the "byte identical" sense even if the actual metadata doesnt change.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Calibre Content Server to serve the original EPUBs cedhax Related Tools 4 02-23-2020 12:29 PM
calibre-sync: Automatically download books from your Calibre Content Server onto Kobo mishagale Related Tools 14 05-13-2019 05:18 PM
Aura H2O Font size mismatch (downloaded epubs via Calibre vs. Kobo epubs & articles) Oolong Kobo Reader 36 01-25-2019 06:00 AM
Download ePubs from calibre content server without Stanza? barium Apple Devices 18 06-18-2012 07:29 AM
Calibre Server - Fetch Newspaper epubs via rss Spindoctor Calibre 2 02-15-2012 11:50 AM


All times are GMT -4. The time now is 08:10 AM.


MobileRead.com is a privately owned, operated and funded community.