View Single Post
Old 10-21-2020, 02:32 PM   #4693
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,025
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by ownedbycats View Post
I'm having a bit of trouble with a replace_metadata. Again.
When aren't you?

I don't see anything wrong with the first line. It removed the '(years)' strings.

The second line doesn't catch 2010: The Year We Make Contact because internally:

"2010: The Year We Make Contact (1984)" -> "2010: The Year We Make Contact_"

which doesn't match ^2010: The Year We Make Contact$.

You can either:
Code:
## Category standardization and deduplication
 category=> *\([0-9]+\)|\(Video Game\)|\(Video Games\)|(|- Fandom\(Movies\)|\(Movie [0-9]+\)|\(Comics\)|\(TV\))$=>
## or
 category=>(^2010: The Year We Make Contact *$|^Space Odyssey Series - Arthur C. Clarke$)=>2001: A Space Odyssey
Note the " *" are <space>*

You may want to change the first list to also clear leading and trailing spaces. I would have assumed FFF would strip them, but apparently not running multiple sequential patterns. (I'm not going to offer to change the code for fear of it breaking everybody's existing patterns.)

Re: the image question:

FFF's storyId metadata entry already contains the number you are extracting from the URL, and equivalent ID's from other sites.

FFF does not have an mechanism for populating any identifier subfield other than url. What is it you use your identifier:ao3 values for?

Just in case, I should mention: I strongly do not recommend changing the metadata storyUrl or calibre's identifier:url. FFF uses those to identify stories.
JimmXinu is offline   Reply With Quote