Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-06-2024, 12:41 PM   #46
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by ownedbycats View Post
And here I thought I was being creative by doing this to the Formats column:

Attachment 207382
quite similar to my current ones

Click image for larger version

Name:	MWSnap 2024-04-06, 13_32_01.png
Views:	291
Size:	92.2 KB
ID:	207384

I would use cover grid most of the time, but recently I've started to play with icons in book list, and the way I'm using them causes misalignments in the title column:

Click image for larger version

Name:	MWSnap 2024-04-06, 13_32_36.png
Views:	272
Size:	14.4 KB
ID:	207383
Comfy.n is offline   Reply With Quote
Old 04-06-2024, 01:16 PM   #47
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Comfy.n View Post
quite similar to my current ones

Attachment 207384

I would use cover grid most of the time, but recently I've started to play with icons in book list, and the way I'm using them causes misalignments in the title column:

Attachment 207383
As a suggestion, I would advise that the icon images have a transparent background. You will notice a more pleasant visual change
dunhill is offline   Reply With Quote
Old 04-06-2024, 01:23 PM   #48
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Hi Wiggo, I liked your icons for book formats. They fit better on dark theme than the ones I'm using. Would you mind sharing them in a zip attachment?

I'd never thought of using a column just for symbols, seems a good thing to do!
Here you are!

Quote:
Originally Posted by chaley View Post
My guess is that "Dan Adams" is the author of books in a different series or no series, and one of those books is appearing ahead of the books with series with a note.

Order is important in "and" search clauses. Clauses following an "and" operate of the results of the previous search clauses. As such they don't see any books already filtered out. This "shortcutting" improves search performance a lot.

Try changing the order of the search to
Code:
search:"=#Has.Series notes" and search:"=#Has._One book per author"
This order ensures that the one-book-per-author search operates on the results of the has-series-notes search.
I always click on "One book per author" last in the tag browser, but it looks like the alphabetical order in the tag browser is decisive, not the click order
Attached Files
File Type: zip cc_icons.zip (70.9 KB, 144 views)
Wiggo is offline   Reply With Quote
Old 04-06-2024, 01:27 PM   #49
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by dunhill View Post
As a suggestion, I would advise that the icon images have a transparent background. You will notice a more pleasant visual change
Sure, I've noticed that recently and I'm glad google images allows searching for transparent icons! Now I only use non-transparent images if there's no suitable transparent alternative.
Comfy.n is offline   Reply With Quote
Old 04-06-2024, 01:29 PM   #50
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by Wiggo View Post
Here you are!
Comfy.n is offline   Reply With Quote
Old 04-06-2024, 01:42 PM   #51
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,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Comfy.n View Post
I would use cover grid most of the time, but recently I've started to play with icons in book list, and the way I'm using them causes misalignments in the title column:

Attachment 207383
I use this icon as a placeholder when I want to avoid misalignments. (I also use it to hide 'Unknown' in the authors field.)
Attached Images
 
ownedbycats is online now   Reply With Quote
Old 04-06-2024, 01:49 PM   #52
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by ownedbycats View Post
I use this icon as a placeholder when I want to avoid misalignments. (I also use it to hide 'Unknown' in the authors field.)
good idea, an invisible icon as a placeholder can be useful, thanks
Comfy.n is offline   Reply With Quote
Old 04-06-2024, 01:54 PM   #53
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I use this icon as a placeholder when I want to avoid misalignments. (I also use it to hide 'Unknown' in the authors field.)
I can't see anything. Where is the icon?



SCNR
Wiggo is offline   Reply With Quote
Old 04-06-2024, 03:01 PM   #54
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Wiggo View Post
I always click on "One book per author" last in the tag browser, but it looks like the alphabetical order in the tag browser is decisive, not the click order
Does it work when the search terms are in the order I suggest?

And yes, the tag browser doesn't know the click order. It emits the search terms in the order they appear in the tag browser (I think), which may or may not be alphabetic.
chaley is offline   Reply With Quote
Old 04-06-2024, 03:04 PM   #55
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Now I only use non-transparent images if there's no suitable transparent alternative.
On windows, irfanview (and probably other programs) can change a color to be transparent. You can click in the icon to select which color to use.
chaley is offline   Reply With Quote
Old 04-06-2024, 07:18 PM   #56
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 893
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by chaley View Post
On windows, irfanview (and probably other programs) can change a color to be transparent. You can click in the icon to select which color to use.
Or online https://www.remove.bg/
dunhill is offline   Reply With Quote
Old 04-07-2024, 04:23 AM   #57
Wiggo
Leftutti
Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.Wiggo ought to be getting tired of karma fortunes by now.
 
Wiggo's Avatar
 
Posts: 549
Karma: 1717097
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
You're very welcome!

I got the icons from https://www.flaticon.com

Quote:
Originally Posted by chaley View Post
Does it work when the search terms are in the order I suggest?
Yep, it works with the correct order - thank you so much, chaley.
Wiggo is offline   Reply With Quote
Old 12-18-2024, 04:02 AM   #58
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
I may have confused things, but lets put that aside.

I have an implementation that doesn't require the temporary VL but respects the current VL. It is a bit more complicated because I wanted to generalize it to any field, not just authors. To use what I describe below you must be running calibre 7.7 or later.

To use it, make a stored template named whatever you want -- I use "get_one_book_per_field_value". The template itself is:
Spoiler:
Code:
python:
def evaluate(book, context):
	field_name = context.arguments[0] if len(context.arguments) == 1 else None
	if field_name is None:
		raise NameError("The argument 'field' wasn't provided")

	db = context.db.new_api
	# Check if we have already computed the necessary data
	book_ids = context.globals.get('book_ids', None)
	if book_ids is None:
		candidates = context.globals.get('_candidates', db.all_book_ids())
		books = {}
		for book_id in db.search(query=''): # restrict the search to the current VL
			if book_id not in candidates:
				continue
			item_values = db.field_for(field_name, book_id)
			if item_values is None:
				continue
			if isinstance(item_values, str):
				item_values = (item_values,)
			for item_val in item_values:
				if item_val not in books or books[item_val]['count'] > len(item_values):
					books.pop(item_val, None)
					books[item_val] = {'count': len(item_values), 'book_id': book_id}
		context.globals['book_ids'] = frozenset(bn['book_id'] for bn in books.values())

	# Check if the current book is to be displayed
	book_ids = context.globals['book_ids']
	return '1' if book.id in book_ids else ''
This template takes one argument, the field (column) you are interested in (authors).

Next, make this template search:
Code:
template:"""program: get_one_book_per_field_value('authors')#@#:b:yes"""
It calls the above stored template with the argument "authors". I recommend you create a saved search with it. I did and named it "one_book_per_author". You now have @Katja_hbg's B.

You also need @Katja_hbg's A. To get it, put this in a stored template named what you want. I named it "item_has_notes". The template is
Spoiler:
Code:
python:
def evaluate(book, context):
	field_name = context.arguments[0] if len(context.arguments) == 1 else None
	if field_name is None:
		raise NameError("The argument for the field name wasn't provided")

	db = context.db.new_api
	items_with_notes = context.globals.get('items_with_notes')
	if items_with_notes is None:
		items_with_notes = db.get_all_items_that_have_notes(field_name)
		context.globals['items_with_notes'] = items_with_notes
		context.globals['item_name_map'] = db.get_item_name_map(field_name)
	item_name_map = context.globals['item_name_map']

	vals = book.get(field_name)
	if vals is None:
		return ''
	if isinstance(vals, str):
		vals = tuple((vals,))
	for val in vals:
		if item_name_map.get(val) in items_with_notes:
			return '1'
	return ''

This template also takes 1 argument, the field (column) name.

Now make another template search
Code:
template:"""program: item_has_notes('authors')#@#:b:yes"""
This calles the stored template with the field name "authors". Again, I recommend you save it as a search. I did that, naming it "author has notes".

You can now do searches like:
  • search:"=author has notes" and search:one_book_per_author
  • formats:epub and tags:foobar and search:one_book_per_author
  • search:one_book_per_author

All of this works for me. I hope it works for you.
Hi @chaley,

Could you please create a similar template to search for each author that has a Link and return only one book per author?
Comfy.n is offline   Reply With Quote
Old 12-18-2024, 06:10 AM   #59
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Comfy.n View Post
Hi @chaley,

Could you please create a similar template to search for each author that has a Link and return only one book per author?
stored template: item_has_links.
Click image for larger version

Name:	Clipboard03.jpg
Views:	58
Size:	176.2 KB
ID:	212534

The template:
Spoiler:
Code:
python:
def evaluate(book, context):
	field_name = context.arguments[0] if len(context.arguments) == 1 else None
	if field_name is None:
		raise NameError("The argument for the field name wasn't provided")

	db = context.db.new_api
	items_with_links = context.globals.get('items_with_links')
	if items_with_links is None:
		items_with_links = db.get_link_map(field_name)
		context.globals['items_with_links'] = items_with_links

	vals = book.get(field_name)
	if vals is None:
		return ''
	if isinstance(vals, str):
		vals = tuple((vals,))
	for val in vals:
		if val in items_with_links:
			return '1'
	return ''

The documentation:
Spoiler:
Code:
Return ``True`` if any ``item`` in the ``field`` named by ``field_name``, the argument to the template, has a link.

Saved search "author_has_links:
Spoiler:
Code:
template:"""program: item_has_links('authors')#@#:b:yes"""
Search to show one book per author that has links:
Spoiler:
Code:
search:"=author_has_links" and search:"=one_book_per_author"

This attachment is an importable copy. Import of stored templates is available in calibre source as of 18 Dec 2024, and release 7.23.
Attached Files
File Type: txt item_has_links.txt (835 Bytes, 46 views)

Last edited by chaley; 12-18-2024 at 08:30 AM.
chaley is offline   Reply With Quote
Old 12-18-2024, 06:36 AM   #60
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,612
Karma: 7891011
Join Date: Sep 2020
Device: none
Perfect,

This will help me in populating the author links for GR Author Notes plugin.

(template:"""program: item_has_notes('authors')#@#:b:yes""" and template:"""program: get_one_book_per_field_value('authors')#@#:b:yes"" ") not search:"=item has links"

will allow me to filter the ones that have Bio and don't have links.

Last edited by Comfy.n; 12-18-2024 at 06:42 AM.
Comfy.n is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Books sent to Amazon show with my email as ther author Robmonster Calibre 9 11-05-2020 01:17 PM
Show Books from Only 1 Author RiffRaffAK Library Management 2 06-04-2020 10:26 AM
Expanded search option for "Show books by the same author as the current book" ALT+A Sisela Library Management 1 11-28-2015 09:54 AM
author search in book details panel mobic Library Management 3 11-26-2015 10:50 AM
To show author and author sort as same? pinky62 Library Management 5 03-18-2014 12:55 PM


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


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