View Single Post
Old 02-26-2023, 11:56 PM   #14
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,086
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
The other problem with search & replace - longtext column stores original values, so replace_metadatas have no effect. In this specific case, I also wanted to see what all the ratings were before deciding how to 'standardize' them:

Code:
## Ratings
 rating=>^(K|K\+)$=>General Audiences
 rating=>^Teen And Up Audiences$=>Teen and Up Audiences
 rating=>^T$=>Teen and Up Audiences
 rating=>^Mature$=>Mature Audiences
 rating=>^M$=>Mature Audiences
Anthologies are a bit of a special case, though. They basically concat all the ratings and return them as a string.

What I did in this case was use Action Chains to run a single-field edit with this gpm template:

Code:
program:
## list_remove_duplicates probably isn't necessary
	list = list_remove_duplicates($#fanficrating, ',');

	first_non_empty(
		if 'Explicit' inlist list then 'Explicit' fi,
		if 'Mature Audiences' inlist list then "Mature Audiences" fi,
		if "Teen and Up Audiences" inlist list then "Teen and Up Audiences" fi,
		if "General Audiences" inlist list then "General Audiences" fi,
		if "Not Rated" inlist list then "Not Rated" fi
	)
(I later improved the template, using a custom function. The provided one is easier to set up.. )

Last edited by ownedbycats; 02-26-2023 at 11:58 PM.
ownedbycats is offline   Reply With Quote