View Single Post
Old 10-11-2022, 01:21 PM   #42
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,529
Karma: 8075744
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Here is the example python template from earlier in the thread, updated to use the new signature.
Code:
python:
def evaluate(book, context):
	if book.series is None:
		return ''
	ans = set()
	db = context.db
	for id_ in db.search_getting_ids(f'series:"={book.series}"', ''):
		ans.update([v.strip() for v in db.new_api.field_for('author_sort', id_).split('&')])
	return ', '.join(v.replace(',', ';') for v in sorted(ans))

Last edited by chaley; 10-11-2022 at 01:24 PM.
chaley is offline   Reply With Quote