View Single Post
Old 12-27-2021, 04:16 PM   #252
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: 11,110
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
I was trying to change my 'genres' column like so:

Code:
program:
# Current virtual library
	vl = current_virtual_library_name();

## Main three 'categories' of books. fanfic is taglike, manual enumerated
	tags = $tags;
	fanfic = $#fanficcat;
	manual = $#manualtype;

## Stripping sub-tags of fanfic and manual to use their specific columns instead
	stripped_tags = list_re_group(tags, ',', '.',
			'^(Fanfiction|Documentation & Manuals)($|\..*$)',
			'{$}', '');

## Splitting tag hierarchy
	split_tags = re(stripped_tags, '\.', ',');

## Removing a few unwanted tags
cleaned_tags = list_difference(
			split_tags,
			'@cleanup, Cultures & Regions, School, Social Issues',
			',');

## Trying to concenate the three book categories for shared VLs. Otherwise just use the cleaned tags.
	if
		'(Read|Unread|On Device|Cleanup)' in vl 
	then 
		list_union(cleaned_tags, fanfic, manual, ',') 
	else
		cleaned_tags
	fi
1. Line 27's list_union isn't working as long as I have 'manual' in there, which I'm guessing is due to it being an enumerated column instead of taglike. How do I use it in the list_union?

2. How do I add 'All Books' to the three VLs I have listed?

3. Is it expected for the list_union's combined entries to display in the opposite order? (e.g., "Mass Effect Trilogy, Fanfiction" even though the first is from fanfic, which is second in list).

4. Sometimes if I switch between multiple VLs/views too quickly, the column 'sticks' and displays the wrong entries until I press F2 and re-save the template. Any tips to unstick it?

If any help, this mostly happens when I switch between Fanfiction (where the view manager doesn't even have the column displayed) and Read/Unread.

Worst case, I'll just used combined entries for all VLs - the minor nuisance of having fanfic categories shown twice in book details I can deal with.

Last edited by ownedbycats; 12-27-2021 at 04:37 PM.
ownedbycats is offline   Reply With Quote