View Single Post
Old 05-07-2024, 09:36 PM   #6
tsparr
Junior Member
tsparr began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2024
Device: Kindle Paperwhite (11th Generation)
Sorry for the triple post at this point, but I ended up moving to Python because it just made way more sense to me. It's a little bit slower to run, but I'm only occasionally saving books out to disk.

Code:
python:
def evaluate(book, context):
	if book.series is None:
		author_str = ""
		for author in range(len(book.authors)):
			author_str += book.authors[author]
		book_str = book.title + ' - ' + author_str + '/' + book.title + ' - ' + author_str
	else:
		book_str = book.series + '/' + book.series + ' - ' + f"{int(book.series_index):02}" + ' - ' + book.title

	return book_str
tsparr is offline   Reply With Quote