View Single Post
Old 08-31-2022, 11:15 AM   #7460
AbyssalAriel
Member
AbyssalAriel began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Aug 2022
Device: none
I got around to trying the conditional regex stuff with the help of regex101.com, but it's giving me weird results.

Spoiler:

Code:
[defaults]
add_to_extra_valid_entries:,datePublishedCopy,dateUpdatedCopy,numChaptersCopy,chapterslashtotalCopy,numWordsCopy,mergedEntry

include_in_datePublishedCopy:datePublished
include_in_dateUpdatedCopy:dateUpdated
include_in_numChaptersCopy:numChapters
include_in_numWordsCopy:numWords
#AO3
include_in_chapterslashtotalCopy:chapterslashtotal 

## Add labels to the copies
add_to_replace_metadata:
 datePublishedCopy=>(.*)=>Published:\s\1
 dateUpdatedCopy=>(.*)=>Completed:\s\1
 numChaptersCopy,chapterslashtotalCopy=>(.*)=>Chapters:\s\1
 numWordsCopy=>(.*)=>Words:\s\1

mergedEntry_label:Stats

## Suppress list sorting
keep_in_order_mergedEntry:true
## Merge together
join_string_mergedEntry:\s|\s

[archiveofourown.org]

add_to_extra_valid_entries:,romships,platships
romships_label:Romantic Ships
platships_label:Platonic Ships

include_in_romships:ships
include_in_platships:ships

# only include / ships in romships and & ships in platships.
# & because HTML
add_to_include_metadata_post:
 romships=~/
 platships=~&

keep_in_order_freeformtags:true
keep_in_order_ao3categories:true
keep_in_order_fandoms:true
keep_in_order_genre:true
keep_in_order_category:true
keep_in_order_characters:true
keep_in_order_ships:true
keep_in_order_romships:true
keep_in_order_platships:true

exclude_metadata_pre:
 freeformtags,genre==Other Additional Tags to Be Added

# Example
# Published: 2022-08-30 | Completed: 2022-08-31 | Chapters: 2/2 | Words: 2,000
include_in_mergedEntry:datePublishedCopy,dateUpdatedCopy,chapterslashtotalCopy,numWordsCopy
add_to_replace_metadata:
 # Delete "Completed" if same date
 mergedEntry_LIST=>(\d{4}-\d{1,2}-\d{1,2})\s\|\sCompleted:\s\1=>\1\s\|
 # Delete chapter count if 1/1
 mergedEntry_LIST=>Chapters:\s1/1\s\|\s=>
 # If complete (same chapter number as total), change chapterslashtotal to just chapter count
 #                 1            2     3   4
 mergedEntry_LIST=>(Chapters:\s)(\d*)/(\2)(\s\|\s)=>\1\2\4
 # If it still has a "Completed", it must have a separate publish date.
 # If it still has a slash, that means it's in-progress.
 # So show "Updated" instead of "Complete".
 mergedEntry_LIST=>Completed:(.*)/=>Updated:\s\1/

titlepage_entries:rating,warnings,ao3categories,fandoms,
 romships,platships,characters,genre,
 bookmarked,bookmarktags,bookmarksummary,
 seriesHTML,series01HTML,series02HTML,series03HTML,collections,
 mergedEntry,description


This is giving me outputs like this on the titlepage:

Code:
Published: 2021-05-23Published: | Updated: 2021-05-23Completed: | Chapters: 1/1Chapters: | Words: 2,781Words:
It seems to be adding in extra copies of the labels on the end, and I can't see where I messed up to cause that. It's also a total mystery to me how it's managing to kind of finish the "Updated" part despite all the other junk in the way.

Quote:
Originally Posted by JimmXinu View Post
Generating and injecting the title page are the easy parts.
Well, maybe it would be easy if I knew my way around the codebase/where things happened, or had looked at python code more recently than 5 years ago

Quote:
Originally Posted by JimmXinu View Post
The hard part is fitting it into the existing FFF plugin logically, intuitively, and cleanly.
I don't see how fitting it in would be hard, unless by "intuitively" you meant stuff like this sort of user expectation: https://www.mobileread.com/forums/sh...postcount=3407

In any case though, I doubt my attempt will be especially neat or clean.
AbyssalAriel is offline   Reply With Quote