Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 10-28-2024, 05:46 PM   #1036
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,173
Karma: 1270433
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by BetterRed View Post
The only reason I can imagine one would want to select multiple authors in Manage authors would be to attach the same note to multiple authors, but a subsequent change or delete in one author would not ripple through to other authors.


Works for me, viz:

Attachment 211728

BR
The reason I wanted to select multiple books would be to use th GR Notes Plugin.

And the error only happens with calibre preview. @chaley already fixed it.
thiago.eec is offline   Reply With Quote
Old 10-28-2024, 05:52 PM   #1037
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,288
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by BetterRed View Post
Works for me, viz:

Attachment 211728

BR
Are you on 7.20 or 7.20.100? The change was made between the two (#2085152).
ownedbycats is offline   Reply With Quote
Advert
Old 10-28-2024, 06:48 PM   #1038
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,487
Karma: 29308976
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by thiago.eec View Post
The reason I wanted to select multiple books would be to use th GR Notes Plugin.
Ah-ha - I don't use that plugin or anything like it.

Quote:
Originally Posted by ownedbycats View Post
Are you on 7.20 or 7.20.100? The change was made between the two (#2085152).
I use the current installable version - so 7.20.

I install the portable version of preview releases so that I can see what's coming but I don't use it 'in anger', and I would only refer to it here if I had a problem with it.

BR

Last edited by BetterRed; 10-28-2024 at 06:51 PM.
BetterRed is offline   Reply With Quote
Old 11-19-2024, 11:05 PM   #1039
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,288
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Stored template: colours_daysbetween()

Code:
program:

	arguments(date, colourA, colourB, colourC);
	now = format_date(today(), 'yyyy-MM-dd');

	if days_between(now,date) <#1 then colourA
	elif days_between(now,date) <=#7 then colourB
	elif days_between(now,date) <=#30 then colourC 
	fi
A shortcut template I use for column colouring, like such:

colours_daysbetween($#lastread, '#00aaff', '#69cfff', '#9bdeff')

Click image for larger version

Name:	2024-11-20 00_13_54-calibre.png
Views:	223
Size:	5.0 KB
ID:	212085

Last edited by ownedbycats; 11-19-2024 at 11:14 PM.
ownedbycats is offline   Reply With Quote
Old 12-11-2024, 12:23 PM   #1040
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,288
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
From chaley is this template which can be used to search for series with more than one book:

Quote:
Originally Posted by chaley View Post
This template search should be fast enough to use in a VL. You probably want to make it a stored template.
Code:
python:
def evaluate(book, context):
	# Return True ('yes') if the value in 'field' is used by more than 'test_count' books.
	# This template only works with single value fields such as Series, Publisher, and enumerations
	field = 'series'
	test_count = 1

	db = context.db.new_api
	id_map = context.globals.get('id_map')
	if id_map is None:
		context.globals['id_map'] = id_map = db.get_item_name_map(field)
		context.globals['item_book_count'] = db.get_usage_count_by_id(field)
	item_book_count = context.globals['item_book_count']

	item_id = id_map.get(book.get(field))
	if item_id is None or item_book_count.get(item_id, 0) <= test_count:
		return ''
	return 'yes'
ownedbycats is offline   Reply With Quote
Advert
Old 12-16-2024, 08:20 AM   #1041
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,288
Karma: 72663495
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
There is no existing built-in way to get the cover size. It can be done in a python template but that requires opening the cover to compute its size, which could be too slow to use. What is "too slow" is up to you.

The template returns the cover size as "width by height". You can play with the formatting.
Code:
python:
def evaluate(book, context):
	db = context.db.new_api
	cover = db.cover(book.id, as_image=True)
	width = cover.width()
	height = cover.height()
	if width and height:
		return f'{str(width)} by {str(height)}'
	return '--'
Also attached is an Action Chain (instructions to install) will writes the template output to a #coversize column with less performance issues.
Attached Files
File Type: zip UpdateCoverSize.zip (2.6 KB, 200 views)

Last edited by ownedbycats; 12-16-2024 at 10:29 AM.
ownedbycats is offline   Reply With Quote
Old 12-29-2024, 09:41 PM   #1042
Magic815
Enthusiast
Magic815 has learned how to buy an e-book online
 
Posts: 37
Karma: 98
Join Date: May 2022
Device: Kindle Paperwhite 11th Gen (2021)
Hi all - so I've been using the following metadata plugboard for a while to edit book titles on my Kindle for proper sorting:
Quote:
{series}{series_index:0>2s| #| – }{title}
However, I recently sent the books from the Stormlight Archive to my Kindle, and realized the #2.5 and #3.5 books in that series don't sort in the ideal order.

What it currently does:
Quote:
The Stormlight Archive #01 - Title
The Stormlight Archive #2.5 - Title
The Stormlight Archive #02 - Title
The Stormlight Archive #3.5 - Title
The Stormlight Archive #03 - Title
The Stormlight Archive #04 - Title
The Stormlight Archive #05 - Title
Is there a modification I can make to that plugboard that will instead add leading zeroes to the #.5 entries, so that it would do the following?
Quote:
The Stormlight Archive #01 - Title
The Stormlight Archive #02 - Title
The Stormlight Archive #02.5 - Title
The Stormlight Archive #03 - Title
The Stormlight Archive #03.5 - Title
The Stormlight Archive #04 - Title
The Stormlight Archive #05 - Title
Magic815 is offline   Reply With Quote
Old 12-30-2024, 07:13 AM   #1043
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: 30,758
Karma: 59473090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
This is mine
Code:
{series_index:0>5.2f|| - }{title}
What is says is all index numbers will be xx.xx (5 long includes the decimal and 2 fractional)
theducks is offline   Reply With Quote
Old 12-30-2024, 12:31 PM   #1044
Magic815
Enthusiast
Magic815 has learned how to buy an e-book online
 
Posts: 37
Karma: 98
Join Date: May 2022
Device: Kindle Paperwhite 11th Gen (2021)
Quote:
Originally Posted by theducks View Post
This is mine
Code:
{series_index:0>5.2f|| - }{title}
What is says is all index numbers will be xx.xx (5 long includes the decimal and 2 fractional)
That is certainly an option! Although I'm not in love with all those extra leading and trailing zeros for 99% of my series that just do standard 1, 2, 3, etc.

I did end up giving the following a try:
Quote:
program:no_decimal = template('{series}{series_index:0>2s| #| - }{title}');has_decimal = template('{series}{series_index:0>4.1f| #| - }{title}');contains(field('series_index'),'\.',has _decimal,no_decimal)
(Stolen from this post, with the addition of the "#" character.)

It gets me exactly what I was hoping for with leading zeroes for better title matching:
Quote:
The Stormlight Archive #01 - Title
The Stormlight Archive #02 - Title
The Stormlight Archive #02.5 - Title
The Stormlight Archive #03 - Title
The Stormlight Archive #03.5 - Title
The Stormlight Archive #04 - Title
The Stormlight Archive #05 - Title
But the Kindle still sorts it like this:
Quote:
The Stormlight Archive #01 - Title
The Stormlight Archive #02.5 - Title
The Stormlight Archive #02 - Title
The Stormlight Archive #03.5 - Title
The Stormlight Archive #03 - Title
The Stormlight Archive #04 - Title
The Stormlight Archive #05 - Title
As noted in that other post, I wonder if there is some overarching issue with how the Kindle device sorts that? If I had to choose between the above latest view I'm getting vs all my series being 01.00, 02.00, etc. - I think I can live with the 0X.5 entries being slightly out of place fo the very small handful of times they even exist.

But if anyone knows of a way to present the above titles as I've got them (without extraneous trailing zeros) - with proper sorting on Kindle - definitely let me know!

Last edited by Magic815; 12-30-2024 at 12:36 PM.
Magic815 is offline   Reply With Quote
Old 12-30-2024, 01:20 PM   #1045
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Magic815 View Post
But the Kindle still sorts it like this:

As noted in that other post, I wonder if there is some overarching issue with how the Kindle device sorts that? If I had to choose between the above latest view I'm getting vs all my series being 01.00, 02.00, etc. - I think I can live with the 0X.5 entries being slightly out of place fo the very small handful of times they even exist.
It appears that the kindle is doing some kind of numeric sorting, but ignoring the decimal point and later digits. In other words, it is sorting whole numbers, not fractional numbers. This is implied by the example in your post and your example in post 1042 where the list is sorted by whole number, ignoring leading zeros.
Quote:
But if anyone knows of a way to present the above titles as I've got them (without extraneous trailing zeros) - with proper sorting on Kindle - definitely let me know!
I don't have a kindle and can't test this, but it could be that if you put a decimal point after the whole numbered indices then they would sort correctly. By that I mean:
Quote:
The Stormlight Archive #01. - Title
The Stormlight Archive #02. - Title
The Stormlight Archive #02.5 - Title
The Stormlight Archive #03. - Title
The Stormlight Archive #03.5 - Title
The Stormlight Archive #04. - Title
The Stormlight Archive #05. - Title
This template gives you the above:
Code:
program:
	if '\.' in $series_index then
		template('{series}{series_index:0>4.1f| #| - }{title}')
	else
		template('{series}{series_index:0>2d| #|. - }{title}')
	fi
Note the addition of the period in the suffix used for series indices that are whole numbers.

Your example cited above implies that this might work as well:
Quote:
The Stormlight Archive #1. - Title
The Stormlight Archive #2. - Title
The Stormlight Archive #2.5 - Title
The Stormlight Archive #3. - Title
The Stormlight Archive #3.5 - Title
The Stormlight Archive #4. - Title
The Stormlight Archive #5. - Title
This template gives you that:
Code:
program:
	if '\.' in $series_index then
		template('{series}{series_index:.1f| #| - }{title}')
	else
		template('{series}{series_index:d| #|. - }{title}')
	fi
chaley is offline   Reply With Quote
Old 12-31-2024, 01:30 PM   #1046
Magic815
Enthusiast
Magic815 has learned how to buy an e-book online
 
Posts: 37
Karma: 98
Join Date: May 2022
Device: Kindle Paperwhite 11th Gen (2021)
So I tried this one:
Code:
program:
	if '\.' in $series_index then
		template('{series}{series_index:0>4.1f| #| - }{title}')
	else
		template('{series}{series_index:0>2d| #|. - }{title}')
	fi
But it looks like it still sorts like this on my Kindle:
Quote:
The Stormlight Archive #01. - Title
The Stormlight Archive #02.5 - Title
The Stormlight Archive #02. - Title
The Stormlight Archive #03.5 - Title
The Stormlight Archive #03. - Title
The Stormlight Archive #04. - Title
The Stormlight Archive #05. - Title
Appreciate you giving it a shot! I think I can live with x.5 being slightly out of order for the couple series I have where there even exists books with a decimal place.
Magic815 is offline   Reply With Quote
Old 01-06-2025, 06:24 AM   #1047
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,268
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Stored template that returns HTML comments as plain text.

The attached exported stored template, comments_to_plain_text(), converts a comments field to plain text. This can be useful when whatever is processing the comments cannot handle HTML, for example the Generate Cover plugin. See the stored template's documenation for details.
Attached Files
File Type: txt comments_to_plain_text.txt (1.1 KB, 142 views)
chaley is offline   Reply With Quote
Reply

Tags
custom column, tag, tags

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 10:25 PM.


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