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..

)