View Single Post
Old 08-24-2014, 11:51 AM   #3269
MiniMouse
Groupie
MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.MiniMouse ought to be getting tired of karma fortunes by now.
 
MiniMouse's Avatar
 
Posts: 197
Karma: 318144
Join Date: Jul 2013
Location: Well, there will always be a big time delay because I'm not living in the US! And there could be some communication difficulties too because I'm not a native speaker!
Device: Sony PRS-T3S
Quote:
Originally Posted by JimmXinu View Post
Yes, it is possible. But it involves using regular expressions.

Full generate_cover_settings spec:

Spoiler:
Code:
## If you have the Generate Cover plugin installed, you can use the
## generate_cover_settings parameter to intelligently decide which GC
## setting to run.  There are three parts 1) a template of which
## metadata part(s) to look at, 2) a regular expression to match the
## template, and 3) the name of the GC setting to use, which must
## match exactly.  Use this parameter in [defaults], or by site eg,
## [ficwad.com]
## Make sure to keep at least one space at the start of each line and
## to escape % to %%, if used.
## template => regexp to match => GC Setting to use.
## To use this, make sure you go to the Generate Cover tab in FFDL
## config and check 'Allow generate_cover_settings from personal.ini
## to override'
#generate_cover_settings:
# ${category} => Buffy:? [tT]he Vampire Slayer => BuffyCover
# ${category} => Star Trek => StarTrekCover

Because generate_cover_settings applies a regular expression to a string template that can contain any of the book metadata, it is possible to use more than one metadatum.

You do, however, have to allow for having other values, and you have to list them from most specific to least specific because the first line that matches will be the one used:
Code:
# saves having to match both Arthur/Merlin and Merlin/Arthur, etc.
# characters and other lists are already sorted by default.
sort_ships:true

generate_cover_settings:
 ${category}:${characters}:${ships} => .*Merlin.*:.*Arthur, .*Merlin.*:.*Arthur/Merlin.* => CoverMostSpecific
 ${category}:${characters} => .*Merlin.*:.*Arthur, .*Merlin.* => CoverMoreSpecific
 ${category} => Merlin => CoverMerlin
Testing this is an ideal time to use the built-in teststory feature to avoid hitting servers a bunch:

Spoiler:

You'll need to have a copy of the generate_cover_settings, etc that you're testing in [default], [epub] or [test1.com] sections. This is also a good time to be working in a separate test library until you're happy with it.

In personal.ini add:
Code:
[teststory:2000]
add_to_category_list:Merlin

[teststory:2001]
add_to_category_list:Merlin
add_to_characters_list:Merlin,Arthur,Bob,Zack,Aaron

[teststory:2002]
add_to_category_list:Merlin
add_to_characters_list:Merlin,Arthur,Bob,Zack,Aaron
add_to_ships_list:Thor/Jane,Merlin/Arthur
Now when you add/update stories with these URLs, they will have the metadata shown above:

http://test1.com?sid=2000
http://test1.com?sid=2001
http://test1.com?sid=2002


Will try that!

I didn't use the Generate Cover function with FFDL so far because I wanted more than one cover for a fandom, so I always made them directly with the Generate Cover Plugin instead.

Now I can try to stop that

Thank you very much for the quick reply

Though I probably will come back with some more questions along the way

Mini
MiniMouse is offline