View Single Post
Old Yesterday, 05:50 PM   #11262
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,180
Karma: 77304081
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Now that collectionUrl is a valid entry, how should I update Metadata Managemen entry?

Quote:
I like to include specific gift/exchange collections in my Series column rather than using a separate column.

Code:
[archiveofourown.org]

## Copies collections to series
include_in_series:series,collections

add_to_include_metadata_pre:
## Include specific collections as series. Here, I've included both an exact version (==) and regex (=~). 
 collections==Fic Exchange 2023
 collections=~(Fic Exchange \d{4})

add_to_exclude_metadata_pre:
## If a fic also has a series, it'll concatenate the entries. To avoid this, use exclude_metadata_pre with a storyUrl conditional.
 series==Unwanted Series&&storyUrl==https://archiveofourown.org/works/xxxx
## If you're using collection URLs, you will also want to remove the series URL.
 seriesUrl==https://archiveofourown.org/series/xxxx&&storyUrl==https://archiveofourown.org/works/xxxx

## Alternately, if you prefer to keep the series:
 collections==Fic Exchange 2023&&storyUrl==https://archiveofourown.org/works/xxxx

add_to_replace_metadata:
## I apply transformations to 'collections' but applying them to 'series' should also work
 collections=>ficexchange=>Fic Exchange
To also include collection URLs for use on the titlepage and with the 'Set Calibre Series URL' option, add these lines. (Be careful to merge the sections instead of creating duplicate ones.)

Collection URL requires a version of FanFicFare released after April 4, 2023, which added the static include_in_* required for the placeholder (as FanFicFare cannot replace an empty entry).

Code:
[archiveofourown.org]
## This creates an 'collectionUrl' entry and adds a placeholder. I chose to use 'abc' for easy replacement (no escapes!).
add_to_extra_valid_entries:,collectionUrl
include_in_collectionUrl:"abc"

## Adds collectionURL to series.
include_in_seriesUrl:seriesUrl,collectionUrl

add_to_replace_metadata:
## Change the placeholder 'abcs' to collection urls using conditionals
## If you are using a collection name that has been modified by replace_metadata, make sure this goes below it.
 collectionUrl=>abc=>https://archiveofourown.org/collections/FicExchangeLink&&collections==Fic Exchange 2023

add_to_exclude_metadata_post:
## If the placeholder isn't changed during replace_metadata, this will remove it to prevent general breakage
 collectionUrl==abc
ownedbycats is offline   Reply With Quote