Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-13-2019, 07:26 AM   #3481
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
First of all, thanks for this great plugin!

Second, I am running into some issues I can't seem to figure out and I am just about to give up, thus leading to me finally signing up here and posting. Being new to FFF and relatively noob at Calibre in general, I offer my apologies if these are stupid questions I am asking here that are explained somewhere in the documentation that I missed.

Thus far, all my tests are limited to Fanfiction.net (FFN).

1) How to activate a different cover generation profile if there is no cover included with the fic in question? Simplifying away the regex for the series name, the following bit of code sums up my attempts thus far:

Code:
generate_cover_settings:
## Does not seem to work... :(
# ${category},${cover_image} => .SOME_FANDOM.*,(specific,first,default,old) => Fanworks-SOME_FANDOM
## This did though, so cover_image is clearly empty.
 ${category},${cover_image} => .SOME_FANDOM.*, => Fanworks-SOME_FANDOM
 ${category},${cover_image} => .SOME_FANDOM.*,.* => Fanworks-SOME_FANDOM-Default

[epub]
make_firstimage_cover:true
My tests have turned out that despite stories having an associated cover, one that is also listed in the epub, cover_image will be empty. How do I trigger my special default cover? (I don't want the default Calibre books, and I want it to be specific to the series in question, so just replacing the default image is not an option to my knowledge.)

2) How do I create a characters column with smart behaviour like Authors in regards to 'FirstName LastName' entries being shown in the tags list as 'LastName, FirstName'?

I tried creating a comma-separated text column #characters, but the moment I hit the 'As Names' option in that interface, it turns it into an ampersand separated list... which means that whatever FFF tries to give it is suddenly turned into one big list. I guess I need to replace commas by ampersands, but shouldn't FFF already have those names as a list to begin with?

Relevant code snippets:

Code:
replace_metadata:
 characters,ships=>Firstname L.=>Firstname Lastname
 characters,ships=>F. Last=>First Last

add_to_custom_columns_settings: 
 category=>#fandom
 description=>#summary
 rating=>#rating
 characters=>#characters
 ships=>#ships
 status=>#status
 dateUpdated=>#lastupdate
Thank you for taking the time to read this small cry for help.
worstje is offline   Reply With Quote
Old 06-13-2019, 08:56 AM   #3482
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
Quote:
Originally Posted by worstje View Post
1) How to activate a different cover generation profile if there is no cover included with the fic in question? Simplifying away the regex for the series name, the following bit of code sums up my attempts thus far:

Code:
generate_cover_settings:
## Does not seem to work... :(
# ${category},${cover_image} => .SOME_FANDOM.*,(specific,first,default,old) => Fanworks-SOME_FANDOM
## This did though, so cover_image is clearly empty.
 ${category},${cover_image} => .SOME_FANDOM.*, => Fanworks-SOME_FANDOM
 ${category},${cover_image} => .SOME_FANDOM.*,.* => Fanworks-SOME_FANDOM-Default

[epub]
make_firstimage_cover:true
My tests have turned out that despite stories having an associated cover, one that is also listed in the epub, cover_image will be empty. How do I trigger my special default cover? (I don't want the default Calibre books, and I want it to be specific to the series in question, so just replacing the default image is not an option to my knowledge.)

2) How do I create a characters column with smart behaviour like Authors in regards to 'FirstName LastName' entries being shown in the tags list as 'LastName, FirstName'?

I tried creating a comma-separated text column #characters, but the moment I hit the 'As Names' option in that interface, it turns it into an ampersand separated list... which means that whatever FFF tries to give it is suddenly turned into one big list. I guess I need to replace commas by ampersands, but shouldn't FFF already have those names as a list to begin with?

Relevant code snippets:

Code:
replace_metadata:
 characters,ships=>Firstname L.=>Firstname Lastname
 characters,ships=>F. Last=>First Last

add_to_custom_columns_settings: 
 category=>#fandom
 description=>#summary
 rating=>#rating
 characters=>#characters
 ships=>#ships
 status=>#status
 dateUpdated=>#lastupdate
Thank you for taking the time to read this small cry for help.
Do you have the Generate Cover plugin installed?
Tanjamuse is offline   Reply With Quote
Advert
Old 06-13-2019, 09:14 AM   #3483
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
Quote:
Originally Posted by Tanjamuse View Post
Do you have the Generate Cover plugin installed?
Of course.

My default cover generation in the settings is a very generalized one not specific to any fandom.

The entries listed in the personal.ini are specific for a particular fandom, where I want the -Default one to only be used if the website has no cover associated with that fic. But the commented variety never appears to kick in, and the first uncommented line is what will work... but that gives me an ugly image with the default calibre books for the missing cover image.

So I know for a fact that the regular expression that detects the fandom works fine; it is detecting whether or not there is a cover associated with the fic and using the correct profile that is a problem.
worstje is offline   Reply With Quote
Old 06-13-2019, 09:19 AM   #3484
Tanjamuse
Wizard
Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!Tanjamuse , Klaatu Barada Niktu!
 
Posts: 1,327
Karma: 5306
Join Date: Jan 2014
Device: none
This is a sample of my settings for the covers:

Code:
generate_cover_settings:
    ${category} => A Song of Ice => A Song of Ice
    ${category} => Angel => Angel
    ${category} => Bones => Bones
    ${category} => Buffy => Buffy
    ${category} => Chronicles of Narnia => Chronicles of Narnia
    ${category} => Cold Case => Cold Case
    ${category} => Criminal Minds => Criminal Minds
${category} => Fandom => Cover name
Tanjamuse is offline   Reply With Quote
Old 06-13-2019, 10:10 AM   #3485
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
Right, I already have entries like those like you can see in my original post.

My aim is to create custom covers where, if the fic has a cover associated on its website, it shows that as a part of the custom cover. That is not the problem.

The problem is that I want to use a different template if there is no cover associated with this fic on the original website. (This 'default' template has a hard-coded image, no outline around the original cover and some other minor tweaks.)
worstje is offline   Reply With Quote
Advert
Old 06-13-2019, 03:04 PM   #3486
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: 6,994
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
New Test Version Posted

2018-06-13
- Change metadata separator to ' & ' when filling 'Contains names' custom columns.

Quote:
Originally Posted by worstje View Post
First of all, thanks for this great plugin!


Quote:
Originally Posted by worstje View Post
1) How to activate a different cover generation profile if there is no cover included with the fic in question? Simplifying away the regex for the series name, the following bit of code sums up my attempts thus far:

Code:
generate_cover_settings:
## Does not seem to work... :(
# ${category},${cover_image} => .SOME_FANDOM.*,(specific,first,default,old) => Fanworks-SOME_FANDOM
The first thing I see is that your regexp for checking cover_image isn't correct. It should be '|', not ','.
Code:
generate_cover_settings:
## Does not seem to work... :(
# ${category},${cover_image} => .SOME_FANDOM.*,(specific|first|default|old) => Fanworks-SOME_FANDOM
If that doesn't help, please provide an example with actual fandom and some story URLs for that fandom that have and don't have covers--ie, exactly what you're trying to test so I can test it myself.

(Also, I'm not sure why you have '.' before SOME_FANDOM, I'd expect it to be '.*' like after...)

Quote:
Originally Posted by worstje View Post
2) How do I create a characters column with smart behaviour like Authors in regards to 'FirstName LastName' entries being shown in the tags list as 'LastName, FirstName'?

I tried creating a comma-separated text column #characters, but the moment I hit the 'As Names' option in that interface, it turns it into an ampersand separated list... which means that whatever FFF tries to give it is suddenly turned into one big list. I guess I need to replace commas by ampersands, but shouldn't FFF already have those names as a list to begin with?
The Calibre method FFF uses expects a string, not a list, when setting custom columns and then later splits that string for itself. When you change the column type to 'Contains names', that changes what Calibre splits on from ',' to '&'.

There are ways using FFF settings to change the separators, but FFF was hard-coded to use ', ' when adding to existing using the a flag in custom_columns_settings.

So, since I needed to change it in that one place, I added code to FFF to do the ', ' to ' & ' change when filling a 'Contains names' column.
JimmXinu is offline   Reply With Quote
Old 06-13-2019, 03:49 PM   #3487
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
Quote:
The first thing I see is that your regexp for checking cover_image isn't correct. It should be '|', not ','.
... I am a bloody idiot. I should have noticed those commas given how much I use regular expressions. How did I not notice those? The thing I redacted definitely has several of them in it.

I have to apologize on bothering you with that one; I think I spent so much time triple-checking and verifying other lines I thought might interfere that I totally failed to carefully triple-check the one thing I _am_ familiar with.

I'll give it a shot with that change incorporated.

Quote:
(Also, I'm not sure why you have '.' before SOME_FANDOM, I'd expect it to be '.*' like after...)
Simplification error on my part. It is the same regex; I just did a sloppy selection while manually replacing it here while writing my comment. (You'd make a great rubber ducky, did you know that?!)

Quote:
2018-06-13
- Change metadata separator to ' & ' when filling 'Contains names' custom columns.
I will give that one a whirl and will report in with the results after I wrap up what I'm doing. Thanks for the amazing response!
worstje is offline   Reply With Quote
Old 06-13-2019, 05:19 PM   #3488
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
The issues I ran into now work as I've been trying to get them to work. Thanks for the help and patch!

All that remains is to figure out if I can have FFF fold the generated cover back into the epub to be used as a cover, or whether I need a separate plugin to accomplish that.

Another change for another day.
worstje is offline   Reply With Quote
Old 06-13-2019, 06:03 PM   #3489
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: 6,994
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by worstje View Post
Simplification error on my part. It is the same regex; I just did a sloppy selection while manually replacing it here while writing my comment. (You'd make a great rubber ducky, did you know that?!)
I'm not sure what you mean here. But I do love Ernie and his rubber ducky song.

Quote:
Originally Posted by worstje View Post
All that remains is to figure out if I can have FFF fold the generated cover back into the epub to be used as a cover, or whether I need a separate plugin to accomplish that.
There's a setting on FFF's Calibre Cover setting tab for 'Inject/update the cover inside EPUB'.
JimmXinu is offline   Reply With Quote
Old 06-13-2019, 06:07 PM   #3490
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
Quote:
I'm not sure what you mean here. But I do love Ernie and his rubber ducky song.
https://en.wikipedia.org/wiki/Rubber_duck_debugging should answer your unspoken question.

Quote:
There's a setting on FFF's Calibre Cover setting tab for 'Inject/update the cover inside EPUB'.
And somehow I had totally missed that one. I had seen the 'Update Calibre Cover (from EPUB)' option at one point and was like 'that is the exact opposite of what I am looking for!'.

This shows exactly why I need rubber duckies for optimal efficiency. (And it is also a fair argument why I shouldn't try to do anything remotely complicated after midnight, but that last one would be wild speculation...)
worstje is offline   Reply With Quote
Old 06-14-2019, 07:48 AM   #3491
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
This is probably a very stupid question... but how do I 'properly' import a story in my library using the CLI? I am using a variety of the calibre-debug.exe trick that I saw in the FAQ somewhere. (A variation because the exact command did not work, and calibre-debug because I assume the test version is not on Pip yet.)

Code:
c:\Program Files\Calibre2\calibre-debug.exe -r FanFicFare -- -d --library-path=Y:/Fanworks https://www.fanfiction.net/s/4050939/1/Herz-aus-Eis
Unfortunately, the best I can achieve is for it to put the .epub in the same directory as the script. It does not trigger cover generation, nor does it get put into the Calibre library. All I want is for the story go through all the same processes and put the e.pub in the same spot as when I'd manually select the option in the GUI.

I tried without specifying the library path but no good like that, either. What am I missing?
worstje is offline   Reply With Quote
Old 06-14-2019, 10:59 AM   #3492
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: 6,994
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by worstje View Post
Unfortunately, the best I can achieve is for it to put the .epub in the same directory as the script. It does not trigger cover generation, nor does it get put into the Calibre library. All I want is for the story go through all the same processes and put the e.pub in the same spot as when I'd manually select the option in the GUI.
'Unfortunately' is the correct word.

When called via calibre-debug CLI, FanFicFare plugin behaves the same as the FFF Python CLI, not the plugin version. So basic download functionality is all you get.

A number of things the FFF plugin does are simply not available when called via calibre CLI. That includes GUI user interactions and calling other plugins--such as Generate Cover.

In theory, all of the core FFF functions (download, update Calibre metadata, do conversion if optioned) could be re-coded to work from the CLI, but not calling other plugins--not without also incorporating their features or re-writing them.

You can, if desired, configure Calibre to auto-import any ebook placed in a specified directory. Then use FFF via calibre CLI to download and move the resultant file in that dir. But you don't get all FFF's bells and whistles.

Re: FFF CLI test versions, I do post a test version CLI for pip, but I don't always update it for every posted test version:

Code:
 pip install --extra-index-url https://testpypi.python.org/pypi --upgrade FanFicFare
JimmXinu is offline   Reply With Quote
Old 06-14-2019, 11:09 AM   #3493
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
Well, that is definitely very unfortunate. I start out with a URL, so I don't have an ebook to begin with. If I use FFF-CLI to make the ebook, I will have to import that and then somehow manipulate Calibre to replace the cover, manually assign all the custom columns and more of that mess... and probably still break interaction with using FFF from the GUI when I do want to use it from there. (Not to mention the problems involved with having two workflows trying to do the same thing.)

I guess I have to find some other way to go about this.

(When I saw that FFF supported CLI and all the parameters it supported, I had not expected that this of all things would turn out the be the most troublesome issue to tackle! )
worstje is offline   Reply With Quote
Old 06-14-2019, 11:58 AM   #3494
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: 6,994
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Most people just use FFF plugin in GUI mode, or more rarely use CLI to do their own thing, not mix and match.

Between fetching update notices from email, adding to Reading Lists (which can then update devices when attached) and adding/removing from 'To Read' lists, even starting conversions, FFF automates most steps of my fanfic management.

But it's not surprising it does what I want.
JimmXinu is offline   Reply With Quote
Old 06-14-2019, 03:47 PM   #3495
worstje
Member
worstje began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Jun 2019
Device: none
My aim is admittedly bit esoteric. I was trying to set up an endpoint that would allow me to load in new fics without further user interaction so that I can then hook it up to other sources as needed.

A recurring discussion in a small community of readers is 'do you remember a fic about X and Y?!', only to have some true fic addict immediately identify it based on the description. 'Oh, that is Blahblah from Blurb, here's the link!'... and then the link is to a dead fic. I am relatively capable at coding when it isn't around midnight, so I figured I'd just set up a discord bot where people could drop links to their most appreciated fics which would then get stored up just in case some fic would ever get wiped from oblivion.

(Obviously authors have every right to remove their fics, but I feel that if fans were to go out of their way to store such a fic in a communal library of sorts, preserving what is worth preserving is a valid enough aim.)

For now it seems I am stuck doing it all manually. I haven't been able to find any way to make Calibre just eat the custom metadata stored inside the .epub FFF generated so that it fills the custom columns with that data when I manually toss it into Calibre. This makes it all a few hurdles too many.

Still, FFF is a great plugin. I am just weird with what I am trying to achieve.
worstje is offline   Reply With Quote
Reply

Tags
fanfiction


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 523 07-15-2025 06:45 PM
[GUI Plugin] Open With kiwidude Plugins 404 02-21-2025 05:42 AM
[GUI Plugin] Marvin XD Philantrop Plugins 126 01-29-2017 12:48 PM
[GUI Plugin] KiNotes -axel- Plugins 0 07-14-2013 06:39 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 05:41 PM.


MobileRead.com is a privately owned, operated and funded community.