![]() |
#2671 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
|
![]() |
![]() |
![]() |
#2672 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Beta: Template to decide if to send as kepub
I don't use kepubs all the time. And at the moment, I have a library I want to read as epubs and another as kepubs. Don't ask, it's just me. That means I change between the KoboTouch driver and the KoboTouchExtended driver depending on the library. And of course, I forget sometimes. So, I decided I wanted another way to do this.
The obvious way is to have something about the book to decide if to do the kepub transformation or not. The attached add the ability to use a template to do this. If the template is set, and it returns a non-empty value, then the book will be sent as a kepub. If the template returns an empty value the books will be sent as an epub. This is optional. There is an option to turn this on and off. The template I am using is simple: Code:
program: current_library_name()=='Incoming' Code:
program: $$#words > 5000 While doing this, I had to make changes to the drivers configuration. I've always disliked it (sorry Joel) and broke down and reorganised it. The tab for the Extended driver is now organised into three sections:
I think I have the arrangement correct. It should also be more obvious with some options as they will be enabled or disabled based on others. For example, only one of the two options for hyphenation can be enabled at one time. And if the hyphenation is selected, the hyphenation values will be enabled, but, not at other times. There is probably some combination of options that will get the wrong fields enabled. I have been using this for a couple of weeks with no issues. I am happy the kepub template option works. I don't use the hyphenation or other options, so they have had only basic testing. If anyone finds the changes useful, please tell me. And if you find problems, or have suggestions, please tell me as well. Last edited by davidfor; 07-19-2022 at 04:41 AM. Reason: Removed beta as it has been released |
![]() |
![]() |
![]() |
#2673 |
Member
![]() Posts: 19
Karma: 10
Join Date: Jan 2017
Location: Birmingham, UK
Device: Kobo Aura H2O
|
Thanks for your work on this plugin! I manage two Kobo devices with Calibre - my own and (occasionally) my wife's. For my own, I'd like Calibre to synchronise collections, so I have a column set up for that. But I don't want to overwrite my wife's collections on her device when I connect. Is there any way to set up this kind of per-device configuration, like the Kobo Utilities plugin does?
|
![]() |
![]() |
![]() |
#2674 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,000
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#2675 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
I wrote it to use true for sending as kepub and false for epub. Which, for templates is effectively any value for kepub and an empty value for epubs. I'm not sure if that is the correct way round. The option names feel easier as positive. But, maybe it should be "Send as epub". In any case, I assume your #kobocoll is tag-like column. If so, the following should work: Code:
program: in_list($#kobocoll , ',', "\[EPUB\]", "", "1") |
|
![]() |
![]() |
![]() |
#2676 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
An alternative is to use a custom column with a template for the collections. I haven't looked at this before, but there is a function "connected_device_uuid" that could be used. It takes the parameter for the storage and returns the UUID that calibre has in the "driveinfo.calibre" file from the root directory of the device. With that you could use a template something like: Code:
if (connected_device_uuid("main") == 'efb3184b-26e8-4017-8359-51b4168d4a92') then $#mm_collections fi; I have not tested the above for creating collections. The template works in one of my test custom columns. And as it returns a list of tags, it should work with no problems if I used that column as a collection column in the driver configuration. |
|
![]() |
![]() |
![]() |
#2677 | |
Member
![]() Posts: 19
Karma: 10
Join Date: Jan 2017
Location: Birmingham, UK
Device: Kobo Aura H2O
|
Quote:
But a more serious issue is that when the device id does not match, all collections are wiped out, because the driver tries to sync collections for all the books, and finds that the sync column is blank. So that's basically as bad as overwriting the collections for this device, which brings us back to square 1. But it has made me wonder - could it be possible to make the "Collections columns" field in the driver configuration a template? That way we could use the same trick to return a different column name depending on the connected device? In that case, a non-matching device uuid should result in no column being specified for collections sync, so the driver will not try to do any syncing. |
|
![]() |
![]() |
![]() |
#2678 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
![]() |
![]() |
![]() |
#2679 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 255
Karma: 49504
Join Date: May 2014
Device: Kobo Libra 2
|
I'm trying out my first Kobo (a Libra 2), and using this plugin. I was reading my second book, and found out that Chapter 11 had gone missing; all that was there was the chapter title. I pulled a copy of the kepub off of the Kobo and opened it with an editor, and confirmed that the text for the chapter was gone.
I deleted it from the Kobo and resent it, and this time it had the chapter intact. I didn't make any configuration changes. What's going on? I don't want to have to flip through every book I transfer to check for errors. Calibre 5.38, KoboTouchExtended 3.5.4, MacOS 12.2.1 |
![]() |
![]() |
![]() |
#2680 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
When was the book originally sent to the device? With the same versions of calibre and the plugin? Any chance of an error when it was first sent? It might help to see the book. Is it somewhere I can get it legally? The ScrambleEbook plugin can produce a version that can be posted, but, it it is possible that would break whatever was the cause. |
|
![]() |
![]() |
![]() |
#2681 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 255
Karma: 49504
Join Date: May 2014
Device: Kobo Libra 2
|
Quote:
I am 95% sure that I did not update Calibre or any extensions on Monday (initial upload) or Tuesday (when I found the error), and that I made no changes to the source file between upload attempts. I did not see an error reported when I transferred it; is there a log file I should check? The book is fan fiction (original source), so it should be legal to post. I extracted the original epub from my backup as it existed on Sunday, before I synced the Kobo on Monday. It looks like I also changed the cover (with Calibre) between the Sunday backup and the Monday first sync, so it isn't exact, but I hope that wouldn't change anything. Chapter 11 in the kepub is missing. |
|
![]() |
![]() |
![]() |
#2682 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 255
Karma: 49504
Join Date: May 2014
Device: Kobo Libra 2
|
Possible bug (or at least a difference of opinion?) with Smarten Punctuation:
If there are em dashes in the source, Smarten Punctuation adds a space before and after the em dash. This is considered incorrect in books. Quote:
I have a book with a lot of em dashes, and adding spaces makes for strange text layout. |
|
![]() |
![]() |
![]() |
#2683 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Also, the formatting around dashes is nowhere near as simple as that quote makes it out. It also varies with countries which includes which dash to use. In the end, it comes down to personal preferences of whoever created the book. |
|
![]() |
![]() |
![]() |
#2684 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 255
Karma: 49504
Join Date: May 2014
Device: Kobo Libra 2
|
Quote:
For what it's worth, this is all of what's left of that chapter in the kepub: Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Unknown</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="../../kte-css/stylehacks.css"/> </head> <body><div id="book-columns"><div id="book-inner"></div></div></body></html> Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Unknown</title> <link rel="stylesheet" type="text/css" href="../../stylesheet.css"/> <link rel="stylesheet" type="text/css" href="../../page_styles.css"/> <link rel="stylesheet" href="../../kte-css/hyphenation.css"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" href="../../kte-css/stylehacks.css"/> </head> <body class="calibre"><div id="book-columns"><div id="book-inner"> <h1 class="block_9" id="toc_id_18"><span class="koboSpan" id="kobo.1.1">Chapter 18</span></h1> <p class="block_10">*</p> <p class="block_11"><span class="koboSpan" id="kobo.2.1">The fire was beginning to die out... Last edited by fogice; 03-31-2022 at 10:51 AM. |
|
![]() |
![]() |
![]() |
#2685 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 14,137
Karma: 105211945
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Can I make this driver use kepub on the fly for one Kobo but epub for all the other Kobos?
|
![]() |
![]() |
![]() |
Tags |
error, kobo aura one |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo Device Driver Update | davidfor | Devices | 284 | 05-24-2019 05:24 PM |
[Device Plugin] Kindle 2, 3, 4, Touch Device Interface MBP Update Mod | cryzed | Plugins | 7 | 10-28-2012 04:58 PM |
[Device Interface Plugin] Update for Nook Color Driver | jmricker | Plugins | 0 | 10-22-2011 10:11 AM |
Touch Kobo Touch Extended 2 Year Warranty - Is it worth the $34.99? | EverC | Kobo Reader | 11 | 08-31-2011 11:47 PM |
Touch Kobo Touch Extended Warranty Program | SensualPoet | Kobo Reader | 1 | 07-17-2011 04:08 AM |