View Single Post
Old 04-14-2021, 12:23 PM   #5787
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,112
Karma: 77213681
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by ownedbycats View Post
Also this is something I'm a little stumped on. Here's a fic.

Code:
replace_metadata: 
 category=>^Rescuers$=>The Rescuers

## Sorts anything other than a few selected categories into "Fanfiction.Other"
 tagscategory=>^(?!.*(Half-Life|Portal|Mass Effect|The Elder Scrolls|Disney|Crossover)).*$=>Other

## Adds Fanfiction. to the beginning of tagcategory
 tagscategory=>^(.*)$=>Fanfiction.\1

## Some more tagcategory standardization
## Note that I had more than one fandom in here, I just temporarily removed them to check regexes
 tagscategory=>(The Rescuers)=>Disney

# 'add_to_' concats on to existing param, thus the leading comma
add_to_extra_valid_entries:,tagscategory

# tagscategory is a copy category for Fanfiction.category in tags
include_in_tagscategory:category
include_subject_tags: tagscategory
I tracked it down to specifically the line:
tagscategory=>^(?!.*(Half-Life|Portal|Mass Effect|The Elder Scrolls|Disney|Crossover)).*$=>Other

Commenting that out makes it sort into Fanfiction.Disney. However, that line works perfectly fine for all the other listed categories. Any idea why it's breaking down just for Disney?
I think I figured it out. The regexes are running in the opposite order than I thought; it's changing The Rescuers to Other before it can get changed into Disney.

Unfortunately I am not sure how to fix this—moving the ## Some more tagcategory standardization portion above the others didn't seem to work.

Last edited by ownedbycats; 04-14-2021 at 01:38 PM.
ownedbycats is offline   Reply With Quote