szarroug3 / X-Ray_Calibre_Plugin

X-Ray Creator plugin for Calibre
http://www.mobileread.com/forums/showthread.php?t=273189
GNU General Public License v3.0
57 stars 12 forks source link

add support for startActions, endActions, and author profiles #15

Closed szarroug3 closed 8 years ago

szarroug3 commented 8 years ago

Add an option to create startActions, endActions, and author profiles for each book. This should act like the create x-ray function where it automatically sends the file to the device (if the option is checked in the preferences.

There should also be a corresponding send to device action that acts like the send x-ray function.

szarroug3 commented 8 years ago

@stoduk Have you ever done/looked into this before? I know you mentioned this is something you were interested in having as a feature. I can't seem to figure out what endActions actually does. Maybe I've been putting it in the wrong location on my kindle?

stoduk commented 8 years ago

Yes, I documented a bunch of it on the github for the old project: https://github.com/stoduk/calibre_plugin_xray/blob/master/SPECIFICATION.md

I was having a go at this the other day, and found out (as is the case with most of these files) that the minimal number of fields is a tiny subset of what can be there - see below. Thought this base EndActions is only enough to enable amazon/goodreads voting (what I care about!), and not the "other books of interest" info (which is interesting but more a nice to have than essential).

[in fact: setting some of the fields I haven't set here will actually break or confuse voting - I think Kindle used to store your previous vote in this data (so is strangely both read and write data), though in the latest firmware it seems to not do this]

The file goes in the foobar.sdr/ directory, along with the XRAY.entities.{ASIN}.asc file.

I only twigged yesterday that the XRAY file the plugin creates doesn't have {ASIN} in its name, but {calibre ID}_{ebook format} or {ASIN}_{ebook format}. XRAY seems to work with this (as long as the value matches what is stored in the book), but if you are having problems with EndActions this might be coming in to play.

anthony$ cat  "/Volumes/Kindle//documents/Weir, Andy/Martian, The - Andy Weir.sdr/EndActions.data.B00FAXJHCY.asc"
{"bookinfo": {"asin": "B00FAXJHCY", "contentType": "EBOK", "class": "bookInfo"}}
anthony$ 
szarroug3 commented 8 years ago

Hm, weird.. My books always give me the vote on goodreads option regardless of whether I have endActions or not.. That's probably why I couldn't figure out what it was doing. I guess the difference is it doesn't have Amazon rating.

I use whatever id the book on the kindle has because I realized that changing it to the asin made the kindle delete the book cover on the kindle and download one from Amazon (which is nice but I don't think everyone would like it). So instead, I use whatever is already there and I add the book format to the end then I update the filename of the book cover to reflect the change. Turns out updating the filename is actually the cause of issue #2.

Hm, maybe I forgot to use my custom asin in the book info section.. Will test this today.

stoduk commented 8 years ago

For whatever reasons, kindle guys chose to always have the voting option there even if it won't work. The snippet I added was updating both goodreads and Amazon successfully.

On 18 May 2016, at 14:17, szarroug3 notifications@github.com wrote:

Hm, weird.. My books always give me the vote on goodreads option regardless of whether I have endActions or not.. That's probably why I couldn't figure out what it was doing.

I use whatever id the book on the kindle has because I realized that changing it to the asin made the kindle delete the book cover on the kindle and download one from Amazon (which is nice but I don't think everyone would like it). So instead, I use whatever is already there and I add the book format to the end then I update the filename of the book cover to reflect the change. Turns out updating the filename is actually the cause of issue #2.

Hm, maybe I forgot to use my custom asin in the book info section.. Will test this today.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

szarroug3 commented 8 years ago

Yeah I'll have to test it later.. And yeah I'm like that.. What if one day I decide I want to vote on amazon for some reason lmao

On Wed, May 18, 2016, 10:02 AM Anthony Toole notifications@github.com wrote:

For whatever reasons, kindle guys chose to always have the voting option there even if it won't work. The snippet I added was updating both goodreads and Amazon successfully.

On 18 May 2016, at 14:17, szarroug3 notifications@github.com wrote:

Hm, weird.. My books always give me the vote on goodreads option regardless of whether I have endActions or not.. That's probably why I couldn't figure out what it was doing.

I use whatever id the book on the kindle has because I realized that changing it to the asin made the kindle delete the book cover on the kindle and download one from Amazon (which is nice but I don't think everyone would like it). So instead, I use whatever is already there and I add the book format to the end then I update the filename of the book cover to reflect the change. Turns out updating the filename is actually the cause of issue #2.

Hm, maybe I forgot to use my custom asin in the book info section.. Will test this today.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/szarroug3/X-Ray_Calibre_Plugin/issues/15#issuecomment-220054948

szarroug3 commented 8 years ago

You were right.. I tried updating the ASIN in the endActions bookInfo and that fixed it.

Update: to be more clear, I mean I updated it to my custom format ({calibreid}{book_format})

stoduk commented 8 years ago

Voting on amazon isn't that interesting to me. Voting on Goodreads is essential though - it means once I've read a book it gets counted against my annual reading challenge target :)