View Single Post
Old 03-05-2024, 03:26 AM   #3
Randrewy
Junior Member
Randrewy began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2024
Device: pocketbook 740
Quote:
calibre's epubcfi support was added long before that spec existed
Ah, I see. Ok, so currently my algorithm is:
for example, given this identifier "#epubcfi(/6/68!/4/2/2/152/1:160)"
  1. remove `/6`
  2. remove `/68!, convertt it (x/2 -1) to 33 and store as `spine_index`
  3. add extra `/2` to the begining
  4. at this point i think result is what I need, though sometimes offsets (:160) missmatch, I'm still investigating this part, but I think the issue is because book on reader had another structure (the book itself is deleted though I can link it to the one in calibre library using some metadata)


Btw, looked at the code and now I'm almost sure it is correct algo. Another question is, are there any plans to support epubcfi? I think I could help with that, but I'm very new to calibre source code
Randrewy is offline   Reply With Quote