Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-21-2017, 12:21 PM   #1096
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,818
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
CP does not use the DEVICE config screen (the top)

You need to set up Custom columns of the correct type, the configure CP to use those (the names are only suggested)

But in the end, I stll think the Kindle will do its own thing when transfered (the CP columns are for YOU to see in Calibre).
theducks is offline   Reply With Quote
Old 05-21-2017, 07:58 PM   #1097
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
@J-Wo: Sorry, I can't help here. My Kindle knowledge is very low. I know the driver can do something with the page count, but, I don't know what. Also, you haven't actually told us what the problem is. I assume it is that the page count calculated by the Count Pages plugin are not appearing on your Kindle, but, that's really just a guess. If that is the case, and there is a value in the #pages column when you send the book to the device, then it isn't a problem with this plugin.

And that last statement reminds me to ask the obvious question: Are you running Count Pages for the books before sending them to the device?
davidfor is offline   Reply With Quote
Advert
Old 05-21-2017, 08:03 PM   #1098
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by BeckyEbook View Post
Hello,

Please change code for LubimyCzytac in config.py file.
Remove "www." from link, because LubimyCzytac website working without "www" now.

Is:
Code:
'URL': 'http://www.lubimyczytac.pl/ksiazka/%s',
Should be:
Code:
'URL': 'http://lubimyczytac.pl/ksiazka/%s',
TIA.

Becky
Becky: Sorry, I completely forgot about this over the weekend.

Everyone: I promise I'll release it this week or next weekend. If you don't see anything by the weekend, nag me a little so I don't forget.
davidfor is offline   Reply With Quote
Old 05-21-2017, 10:35 PM   #1099
J-Wo
Member
J-Wo began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2017
Device: Kindle Paperwhite
Quote:
Originally Posted by davidfor View Post
@J-Wo: Sorry, I can't help here. My Kindle knowledge is very low. I know the driver can do something with the page count, but, I don't know what. Also, you haven't actually told us what the problem is. I assume it is that the page count calculated by the Count Pages plugin are not appearing on your Kindle, but, that's really just a guess. If that is the case, and there is a value in the #pages column when you send the book to the device, then it isn't a problem with this plugin.

And that last statement reminds me to ask the obvious question: Are you running Count Pages for the books before sending them to the device?
Yes you're right sorry I wasn't clear. After transferring a MOBI or AZW3 file to my Kindle Paperwhite, I still only see Loc, Mins left in chapter, and Mins left in book. I don't see any page numbers on my books.

I am running Count Pages for the books, and they do show up in my custom Pages column on Calibre. Before sending the book to my device, do I have to reconvert it again? If the book is already on my device, do I just need to resend the metadata?

Quote:
Originally Posted by theducks View Post
CP does not use the DEVICE config screen (the top)

You need to set up Custom columns of the correct type, the configure CP to use those (the names are only suggested)

But in the end, I stll think the Kindle will do its own thing when transfered (the CP columns are for YOU to see in Calibre).
What do you mean by "CP does not use the DEVICE config screen (the top)". What is (the top)?

Here is how I've configured my device in Calibre:

Quote:
Originally Posted by kiwidude View Post
Sending your Custom Count to a Kindle:
  • You can enable sending your custom page count column to your Kindle (requires calibre 0.8.40 or later)
  • Go to Preferences -> Plugins -> Device Interface plugins -> Kindle 2/3/4/Touch Device Interface and click Customise plugin.
  • Type the name of your custom column in the textbox as shown in the attached screenshot 6 below.
I already posted my problems in the Kindle forum, and they suggested I come here instead. Now it looks like there are no Kindle owners in this plugin thread? I'm really confused!
J-Wo is offline   Reply With Quote
Old 05-21-2017, 10:58 PM   #1100
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by J-Wo View Post
Yes you're right sorry I wasn't clear. After transferring a MOBI or AZW3 file to my Kindle Paperwhite, I still only see Loc, Mins left in chapter, and Mins left in book. I don't see any page numbers on my books.

I am running Count Pages for the books, and they do show up in my custom Pages column on Calibre. Before sending the book to my device, do I have to reconvert it again? If the book is already on my device, do I just need to resend the metadata?

I already posted my problems in the Kindle forum, and they suggested I come here instead. Now it looks like there are no Kindle owners in this plugin thread? I'm really confused!
From what I can tell, you are using the Count Pages plugin correctly. And you have the Kindle driver configured correctly. Sending the book to the device should be enough. But, I don't know what the Kindle driver and device does with it. And that's a question for the driver maintainer or others who use this function in the driver. Unless someone who uses this plugin and sends the counts to a Kindle sees this, I would suggest starting a new thread and asking. I do vaguely remember discussion on this, so a search might find the answer.
davidfor is offline   Reply With Quote
Advert
Old 05-21-2017, 11:15 PM   #1101
J-Wo
Member
J-Wo began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2017
Device: Kindle Paperwhite
Quote:
Originally Posted by davidfor View Post
From what I can tell, you are using the Count Pages plugin correctly. And you have the Kindle driver configured correctly. Sending the book to the device should be enough. But, I don't know what the Kindle driver and device does with it. And that's a question for the driver maintainer or others who use this function in the driver. Unless someone who uses this plugin and sends the counts to a Kindle sees this, I would suggest starting a new thread and asking. I do vaguely remember discussion on this, so a search might find the answer.
I did notice that my Kindle does not have any .APNX files on it. Isn't that where the page numbers are stored and should be sent to my device by Calibre?

I've also been playing around with the device interface plugin settings, so maybe I screwed something else there. Also there appear to be two Kindle device plugins, so I don't know if one is conflicting with the other?



Last edited by J-Wo; 05-21-2017 at 11:23 PM.
J-Wo is offline   Reply With Quote
Old 05-21-2017, 11:35 PM   #1102
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: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC page numbers are only supported when you send books to e-ink based kindles using the USB connection. Although I dont use that function, so I could be wrong.
kovidgoyal is offline   Reply With Quote
Old 05-21-2017, 11:36 PM   #1103
J-Wo
Member
J-Wo began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2017
Device: Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
IIRC page numbers are only supported when you send books to e-ink based kindles using the USB connection. Although I dont use that function, so I could be wrong.
That's what I'm doing on my PW3
J-Wo is offline   Reply With Quote
Old 05-21-2017, 11:45 PM   #1104
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: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Then run calibre debug mode and look at the log after sending a book, it will likely contain an error message indicating failure reading the page counts or sending the apnx file.
kovidgoyal is offline   Reply With Quote
Old 05-22-2017, 12:05 AM   #1105
J-Wo
Member
J-Wo began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2017
Device: Kindle Paperwhite
Code:
Job: 6 Upload one book to the device:[BOOK_TITLE] started
Device using plugboard azw3 KINDLE2 [[u'{series:|| - }{series_index:0>5.2f|[|] - }{title}', u'title']]
Setting metadata in: [BOOK_TITLE] at: C:\Users\[LOGIN]\AppData\Local\Temp\calibre_yxcq83\2w9wl1caltmpfmt.azw3
DEBUG:   52.3 USBMS: uploading 1 books
Invalid method choice for this book (u'304'), ignoring.
APNX META: guid: 5f2d0932
APNX META: ASIN: da07436c-70ac-4d3e-96c4-___________
APNX META: CDE: EBOK
APNX META: format: MOBI_8
APNX META: Name: [BOOK_TITLE]
APNX Content Header: {"contentGuid":"5f2d0932","asin":"da07436c-70ac-4d3e-96c4-___________","cdeType":"EBOK","format":"MOBI_8","fileRevisionId":"1","acr":"[BOOK_TITLE]"}
Failed to generate APNX
Traceback (most recent call last):
  File "site-packages\calibre\devices\kindle\driver.py", line 545, in upload_apnx
  File "site-packages\calibre\devices\kindle\apnx.py", line 89, in write_apnx
  File "site-packages\calibre\startup.py", line 116, in local_open
IOError: [Errno 2] No such file or directory: u'L:\\documents\\1. Books\\[AUTHOR]\\[BOOK_TITLE]\\[BOOK_TITLE] - [AUTHOR].sdr\\[BOOK_TITLE] - [AUTHOR].apnx'
DEBUG:   53.3 USBMS: finished uploading 1 books
DeviceJob: 6 Upload one book to the device:[BOOK_TITLE] done, calling callback
DEBUG:   53.3 USBMS: adding metadata for 1 books
DEBUG:   53.3 USBMS: finished adding metadata
DeviceJob: set_books_in_library: books to process= 3
DeviceJob: set_books_in_library finished: time= 0.00100016593933
DeviceJob: 6 Upload one book to the device:[BOOK_TITLE] callback returned
Job: 7 Send metadata to device started
DEBUG:   53.3 USBMS: starting sync_booklists
DEBUG:   53.3 USBMS: finished sync_booklists
DeviceJob: 7 Send metadata to device done, calling callback
DeviceJob: 7 Send metadata to device callback returned
Job: 6 Upload one book to the device:[BOOK_TITLE] finished
No details available.
Job: 7 Send metadata to device finished
No details available.

Last edited by J-Wo; 05-22-2017 at 12:07 AM.
J-Wo is offline   Reply With Quote
Old 05-22-2017, 12:18 AM   #1106
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: 43,871
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I cant be sure since you've redacted the title and author, but most likely the full path to the apnx file is too long for windows/the fat32 filesystem on the kindle. You can change your sned to device template to shorten the path by right clicking the device icon in calibre and choosing Configure this device.
kovidgoyal is offline   Reply With Quote
Old 05-22-2017, 11:43 AM   #1107
J-Wo
Member
J-Wo began at the beginning.
 
Posts: 11
Karma: 10
Join Date: May 2017
Device: Kindle Paperwhite
Yes you are absolutely right. I recently installed the Goodreads metadata plugin and it updated my book with a very long title. So after renaming the title to something shorter, I now get page numbers on my Kindle! Thanks for the help @ kovidgoyal
J-Wo is offline   Reply With Quote
Old 06-07-2017, 06:40 AM   #1108
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by red_dragon View Post
Actually it can be a little bit tricky to get it right. I found a good German description how to set up your own custom column that shows the reading time:

https://www.e-reader-forum.de/e-book...lten/?pageNo=2

Even if you don't speak German you should be able to follow the code and the screenshots.

The real fun started when I wanted to convert the floating point number into a string with hour and minute (e.g. 6.7 -> 6:42h). The template functions are very limited so I came up with some ugly code to do the job.
Thanks for the link! Could you post the code you used to convert into hours and minutes?
Nicolas F is offline   Reply With Quote
Old 06-09-2017, 02:38 AM   #1109
red_dragon
Daywalker
red_dragon is on a distinguished road
 
Posts: 29
Karma: 52
Join Date: Jul 2008
Device: Kindle Paperwhite
Beware, this is kind of ugly because Calibre doesn't provide math functions (especially modulo) that would make life so much easier.

Code:
program:

# This program calculate a reading time per hour for a ebook

# Adjustments:
# w_min -> minimum words per minute
# w_max -> maximum words per minute
w_min=250; 
w_max=450;

# readingtime per hour=60
p_time=60;

# Needs a custom column for word count (#words)
# change it to your field name
words=raw_field('#words');

time1=format_number(divide(words,multiply(w_max, p_time)), '{0:.2f}');
time2=format_number(divide(words,multiply(w_min, p_time)), '{0:.2f}');

# Unfortunately Calibre doesn't provide a simple way to convert a float
# into a time string so I do it the really REALLY hard way.

# get the hour BUT take into consideration that Python rounds 
# the numbers automatically!
# Subtracting 0.49 should always yield the correct value 
# (e.g. 9.0 -> 8.51 -> rounded up to 9)
# To the minutes I add a leading '0' for easier conversion later,
# otherwise times are displayed as 4:4h instead of 4:04h.
rt1_hour=format_number(subtract(time1, 0.49), '{0:.0f}');
rt1_minute=format_number(multiply(subtract(time1,rt1_hour),60), '0{0:.0f}');

rt2_hour=format_number(subtract(time2, 0.49), '{0:.0f}');
rt2_minute=format_number(multiply(subtract(time2,rt2_hour),60), '0{0:.0f}');


# It can also happen that the hour value is -0 (!) if the 
# reading time is < 30min.
rt1_hour = re(rt1_hour, '-', '');
rt2_hour = re(rt2_hour, '-', '');

# only the last 2 chars are needed from the minutes.
readingtime=strcat(rt1_hour,':', substr(rt1_minute, -2, 0), 'h - ', rt2_hour, ':', substr(rt2_minute,-2,0), 'h');
red_dragon is offline   Reply With Quote
Old 06-09-2017, 05:26 AM   #1110
Nicolas F
Groupie
Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.Nicolas F once ate a cherry pie in a record 7 seconds.
 
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
Quote:
Originally Posted by red_dragon View Post
Beware, this is kind of ugly because Calibre doesn't provide math functions (especially modulo) that would make life so much easier.
Thank you! I couldn't get it to work...
I just changed 0.49 with 0.499 because I had two books that gave me reading times of X hours and -1 minutes (the reading time in hours was something like 3.9917).

Edit: and after having looked at it a little more, I hadn't though to use regex, but we could also simply do rt1_hour=re(time1, '\.\d*', ''); to truncate the hour... This way no rounding occurs

So here is what I got:
Spoiler:
Code:
program:

# This program calculate a reading time per hour for an ebook

# Adjustments:
# w_min -> minimum words per minute
# w_max -> maximum words per minute
w_min=250; 
w_max=300;

# readingtime per hour=60
p_time=60;

# Needs a custom column for word count (#words)
# change it to your field name
words=raw_field('#words');

time1=format_number(divide(words,multiply(w_max, p_time)), '{0:.2f}');
time2=format_number(divide(words,multiply(w_min, p_time)), '{0:.2f}');

# Unfortunately Calibre doesn't provide a simple way to convert a float
# into a time string -> I used a regex
# The minutes can be set to use 2 numbers using python number formatting,
# otherwise times are displayed as 4:4h instead of 4:04h.
rt1_hour=re(time1, '\.\d*', '');
rt1_minute=format_number(multiply(subtract(time1,rt1_hour),60), '{0:02.0f}');

rt2_hour=re(time2, '\.\d*', '');
rt2_minute=format_number(multiply(subtract(time2,rt2_hour),60), '{0:02.0f}');

readingtime=strcat(rt1_hour,':', rt1_minute, 'h - ', rt2_hour, ':', rt2_minute, 'h');


Thanks again for sharing

Last edited by Nicolas F; 06-09-2017 at 07:00 AM.
Nicolas F is offline   Reply With Quote
Reply

Tags
count, count pages, page count, pages, plugin


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 1184 04-17-2024 06:17 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 12:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 04:34 AM.


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