![]() |
#736 | |
Member
![]() Posts: 16
Karma: 24
Join Date: Jun 2009
Device: Kindle Paperwhite 1
|
Quote:
Code:
def init_cache(library_path = None): from calibre.db.backend import DB from calibre.db.cache import Cache from calibre.utils.config import prefs if library_path == None: library_path = prefs['library_path'] backend = DB(library_path) cache = Cache(backend) cache.init() return cache cache = init_cache() #cache = init_cache('/Users/jasper/Documents/Calibre Main Library/') #cache = init_cache(library_path = '/Users/jasper/Documents/Calibre Test Library/') # # The parameter can be empty, for the currently opened library, # or you can pass a specific Library's path if you wish. # #-------------------- Usage specific code starts here ------------------ import math from collections import defaultdict series_info = defaultdict(dict) fract_ids = [] [.... etc ....] Last edited by JJanssen; 03-28-2016 at 08:31 AM. |
|
![]() |
![]() |
![]() |
#737 |
Connoisseur
![]() Posts: 55
Karma: 10
Join Date: Jul 2015
Location: Curitiba - Brazil
Device: Kindle Paperwhite 3,
|
![]()
Hi! I am testing how to make a plugboard that results in something like this:
When there is a series: [CUSTOMCOLUMN] (series [01]) - Title When there is no series [CUSTOMCOLUMN] - Title But I am not sure how to do it. For now, I managed to get customcolumn - series [01] - Title and customcolunm - Title, using {#customcolumn} - {series}{series_index:0>2s| [|] - }{}{title} What can I change to get my Uppercase and put the brackets and parentheses where I want them? ![]() Last edited by saluli; 04-20-2016 at 07:42 PM. Reason: better formating |
![]() |
![]() |
Advert | |
|
![]() |
#738 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Code:
[{#customcolumn:uppercase()}]{series:| (|}{series_index:0>2s| [|])} - {title} |
![]() |
![]() |
![]() |
#739 |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Oct 2015
Device: none
|
save to disk and switching templates for it
hi
I searched forum and read this whole thread and even though question was asked few times but answers aren't really what I need. when saving to disk if series index has decimal point (I don't know technical term) I need to switch to different template to save it the way I like or to rename when saved. How I like series to look is series 01 , series 02 , series 02.10 etc... to achieve that I use Code:
{authors}/{series}/{authors} - {series} {series_index:0>2s| | - }{title} and Code:
{authors}/{series}/{authors} - {series} {series_index:0>5.2f| | - }{title} Is there a way to tell calibre to recognise that series index has decimal point and to use second template? I don't know if it is possible nor how to write that command so any help would be appreciated, even if it is just to say it isn't possible at all. ![]() |
![]() |
![]() |
![]() |
#740 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: no_decimal = template('{authors}/{series}/{authors} - {series} {series_index:0>2s| | - }{title}'); has_decimal = template('{authors}/{series}/{authors} - {series} {series_index:0>5.2f| | - }{title}'); contains( field('series_index'), '\.', has_decimal, no_decimal) |
|
![]() |
![]() |
Advert | |
|
![]() |
#741 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
chaley,
The simple answer is always the one we don't see. ![]() Does it contain a period. ![]() |
![]() |
![]() |
![]() |
#742 | |
Junior Member
![]() Posts: 6
Karma: 10
Join Date: Oct 2015
Device: none
|
Quote:
![]() I'm sorry I missed it, I'll concentrate better next time when reading I'm grateful you took time to make this more efficient way |
|
![]() |
![]() |
![]() |
#743 |
She/Her
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 87
Karma: 142774
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle PW5 (G001PX) PW3 PW1
|
Custom Column for Amazon Identifier
I want to make a custom column that will show an icon when the amazon identifier is a Kindle ASIN which is 10 characters starting with "B" eg. amazon:B018E7HFDA or amazon:B01ARSC61U but not amazon:0451460715 or when there is no amazon identifier.
Thanks for any help ![]() |
![]() |
![]() |
![]() |
#744 |
She/Her
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 87
Karma: 142774
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle PW5 (G001PX) PW3 PW1
|
I've got as far as this
Code:
program: test(select(field('identifiers'),'amazon'),'1 ','') |
![]() |
![]() |
![]() |
#745 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,345
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You can of course put everything onto one line, making the select the first parameter to re_group. I didn't because assigning to "a" doesn't cost much (if anything) and makes the template much more readable. |
|
![]() |
![]() |
![]() |
#746 |
She/Her
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 87
Karma: 142774
Join Date: Aug 2009
Location: Perth, Australia
Device: Kindle PW5 (G001PX) PW3 PW1
|
Thank you so much, this is perfect!
|
![]() |
![]() |
![]() |
#747 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Aug 2016
Device: Kindle Paperwhite (1st Edition)
|
Hi i am new to the organisation with Calibre and i need some advice to get some custom columns to work.
i want two custom colums on the top so i can sort my ebook to this preference. Spoiler:
The first column should be the reading order like 1, 2, 3 . . .etc. and the second should be the time where the story plays. Spoiler:
so i dont know what i have to put in the spaces for the creation of an custom column to get this working. oh and there are two different times XXXVSY and XXXNSY with NSY comes after VSY (it is the Timeline from Star Wars in German like BBY(Before the Battle of Yavin) and ABY (After the Battle of Yavin)) Spoiler:
I hope someone can help me ![]() sorry for my bad english ![]() |
![]() |
![]() |
![]() |
#748 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jan 2013
Device: Kindle Paperwhite (10th Gen)
|
I have read and attempted various posts/tutorials on how to get the series and book number into the title for my kindle paperwhite. I have created a metadata plugboard specifying ANY Format (originally just mobi) for device KINDLE2 (which is what calibre tells me is connected when I plug my kindle paperwhite up) with the following being used for title: {series}{series_index:0>2s| – | – }{title}
However when I view the book on the device and in calibre's device view the series info is not present. Any suggestions? |
![]() |
![]() |
![]() |
#749 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Plugboards are not supported for dual-MOBI ebooks. Make sure you are converting to AZW3.
|
![]() |
![]() |
![]() |
#750 | |
Member
![]() Posts: 12
Karma: 10
Join Date: Jan 2013
Device: Kindle Paperwhite (10th Gen)
|
Quote:
Can you or anyone else suggest the best filter to use to get author, title, series and series # displayed? I ask because some books with long titles are scrolling off the screen when at the end. Perhaps it should be Book #, Book title, author, series? |
|
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |