View Single Post
Old 02-27-2023, 01:29 PM   #2854
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,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by isarl View Post
Code:
   list_join(':@:',
        list_difference($#readingpool, tags_to_ignore, ','), ',',
        list_difference($tags, tags_to_ignore, ','), ',')
...
Obviously(?) you can do whatever processing you like, it doesn't have to be a call to list_difference.
It is possible that you might want to distinguish between the two columns when looking at collections on the Kobo. It is also possible that the two columns contain the same value but with a different meaning, raising the importance of distinguishing the item values shown on the Kobo.

This template, derived from the above, adds a column name as a prefix to the column value: "Tag:" for tags and "Genre:" for #genre. (I used #genre because that is a column I have, permitting me to test the template before posting.)
Code:
program:
	tags_to_ignore = 'danach, leicht, stopped';
	genres_to_ignore = 'fiction, general';
	list_join(':@:',
		list_re(
			list_difference($#genre, genres_to_ignore, ','),
			',', '(^.*$)', 'Genre:\1'),
		',',

		list_re(
			list_difference($tags, tags_to_ignore, ','),
			',', '(^.*$)', 'Tag:\1'),
		',')
The Kobo sorts the collection names so all the Genre:-prefixed items will appear before the Tag:-prefixed items.
chaley is offline   Reply With Quote