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 11-04-2015, 02:57 PM   #706
saluli
Connoisseur
saluli began at the beginning.
 
Posts: 55
Karma: 10
Join Date: Jul 2015
Location: Curitiba - Brazil
Device: Kindle Paperwhite 3,
The new version worked very well. Thanks for it!

@DavidTC

I spent a lot of time trying to tame AO3 tags to my liking, but the tags are winning.... In some cases I managed to create a working Regex, but usually after hours reading tons of tutorials... Some of the more complex things end being faster to do by hand than to try to get a working regex....

If you manage to find a good way to do it, please share with us!
saluli is offline   Reply With Quote
Old 11-04-2015, 03:07 PM   #707
DavidTC
Connoisseur
DavidTC began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Sep 2011
Device: Nook, Boox C67ML
Quote:
Originally Posted by JimmXinu View Post
Actually, AO3 will let you make a story with both '/' and '&' in the same ship tag. With or without space around either. Yay for freeform tags, I guess?
Well, yeah, you can do it. I'm just saying I (and most people) would really have no idea what that means. If I actually ran across X&Y/Z, I think I would have to mentally parse it as X&(Y/Z), aka, X being friends with the couple Y/Z. Alternately, it means (X&Y)/Z, as in, Z is in a relationship with X, and in a relationship with Y, and X and Y are just friends?

There does not appear to be any standard defined order of operations there. This obviously would cause havoc with *sorting* the tags. (Actually, even with a defined order of operations, it would get complicated.)

However, as combining multiple separators in the same tag doesn't really seem to exist in the wild (Probably because no one would understand it.), I was just suggesting that FFF just give up if it sees two different types, instead of trying to figure it out. (Although it could still run the names past regexps to normalize them.)
DavidTC is offline   Reply With Quote
Advert
Old 11-04-2015, 03:21 PM   #708
DavidTC
Connoisseur
DavidTC began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Sep 2011
Device: Nook, Boox C67ML
Quote:
Originally Posted by JimmXinu View Post

What sites use '/' for romantic ships and '&' for platonic? I don't recall seeing that before. A few example story URLs would also help.
Well, I can just find AO3 ones, like http://archiveofourown.org/works/2824976

Some sites don't do friendship relationships, and some just do *all* relationships the same way.

But I'm pretty certain *if* they are distinguished, that's how they usually are distinguished. / has a long tradition going back to the origins of fanfic for relationships, and & seems like an obvious choice of grouping two characters that isn't that. (Although I wouldn't be surprised to see +.)

Quote:
Originally Posted by JimmXinu View Post
I want to explore the sites that use that a bit before making any decisions. What happens in cases where it's common to have a '/' as part of the name, such as superhero fandoms?
I'm not sure of this question. How is this handled now?

If the site uses / as a separator, and also puts / in names, then sort_ship simply can't work at all, from what I can tell. That's not changed with what I suggested. (I see no solution for that silliness at all.)

If they use / in names and *something else* like | as a separator, well, that sounds like a job for regular expressions changing things going in, and then changing them later. (My problem is I've go *two* different types and I'm trying to end up with two different types. If I just had &, I'd turn them into /, and then back to &.)

Or alternately you could let people list the separators in an option, which would let them list | for that site, and & and / for AO3, and so on.
DavidTC is offline   Reply With Quote
Old 11-04-2015, 03:29 PM   #709
DavidTC
Connoisseur
DavidTC began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Sep 2011
Device: Nook, Boox C67ML
Quote:
Originally Posted by saluli View Post
The new version worked very well. Thanks for it!
I spent a lot of time trying to tame AO3 tags to my liking, but the tags are winning.... In some cases I managed to create a working Regex, but usually after hours reading tons of tutorials... Some of the more complex things end being faster to do by hand than to try to get a working regex....
Oh, don't get me started on AO3 'tags', of which a third appear to be goofy stream-of-consciousness conversations with the reader. I'm just trying to normalize characters and relationships at this point.

*Tags* might, frankly, be me attempting to recognize ten or twenty standardish words like 'Angst' and then erasing everything else.

I have actually considered putting up some sort of wiki with pages saying 'Here are the config parts that should normalize all names in Fandom X'.
DavidTC is offline   Reply With Quote
Old 11-04-2015, 06:30 PM   #710
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,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Cool

Quote:
Originally Posted by DavidTC View Post
I have actually considered putting up some sort of wiki with pages saying 'Here are the config parts that should normalize all names in Fandom X'.
Please do. I'd be happy to put a page under the project wiki for it. (I think anyone with a GitHub account can edit wiki pages.) I've asked before for the people who spend lots of time normalizing tags to share their work with little result.


I've posted a new Test version (direct link) that fixes the problem you reported as well as adding sort_ships_splits and ships_CHARS features.

As requested, you can use replace_metadata on ships_CHARS to operate on the individual parts of ships entries while they are split.

You can use sort_ships_splits to specify more than one regular expression to use to split by and what string to use to join the char parts back together after sorting.

Here are my test settings for it:
Spoiler:
Code:
[defaults]
add_to_replace_metadata:
 ships_CHARS=>Thing=>Object
 characters,ships_CHARS=>Bob=>Wobert

sort_ships:true

## Each line indicates first a regex that should be used to split each
## ships entry and then, after => the string to use to merge the parts
## back together.  \s == blank space.
## Each part will have replace_metadata with key ships_CHARS applied.
## By default, sort_ships_splits:/=>/
sort_ships_splits:
 [ ]*/[ ]*=>\s/\s
 [ ]*&[ ]*=>\s&\s

## here's my tester:
## story URL: test1.com?sid=1002
[teststory:1002]
add_to_category_list:Supernatural
#add_to_category_list:abc,bcd,cde
add_to_genre_list:Action,Romance
chaptertitles:Oneshot,Twoshot
#Prologue,Chapter 1\, Xenos on Cinnabar,Chapter 2\, Sinmay on Kintikin,3. Chapter 3,Chapter 4,Chapter 5,Chapter 6,Chapter 7,Chapter 8
add_to_ships_list:Thor/Jane,Bob,Bob/Thor,Merlin/Arthur,Thing 1/Thing 2,A/B/C,Z/Y/X/V,qewrty / adsf,Harry & Amelia,Ron&Neville&Trevor,Z/A&Y/B
add_to_characters_list:Fred Weasley,George,Bob,Harry
rating:G
Status:Completed
#title:Some Other Title


I had to shift some code around to make this work correctly, so no promises it doesn't break something else. I don't think it does...

(And anybody who asks for sorting by last name instead of string order will be roundly ignored.)
JimmXinu is offline   Reply With Quote
Advert
Old 11-05-2015, 01:44 AM   #711
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
I would love to share the very long list of replace metadata I have, I just don't know where and how, I could also with time add to it with other fandoms than the ones I need, but it's only Characters, Fandoms and ships.
Tanjamuse is offline   Reply With Quote
Old 11-05-2015, 05:48 AM   #712
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
I'm trying to make a custom column in calibre in my fanfiction library. I want to separate pairings and genre (ao3's freeformtags nothwithstanding) to its own column, and I think I've managed it. Only, the column is now empty. I'd like to get the tags needed from the metadata already downloaded into the tags column instead of burdening the servers with a probably unnecessary metadata download, but I'm not sure how to do so.

Can anyone help me out a little here?

Regarding the above mentioned sharing: I'd be willing to contribute as well, but there is something I've noticed about the replace_metadata to consider: There is only a limited amount of metadata replacing possible. (What's that number anyway?) Case in point: I dislike fanfiction.net's shortening of the surnames and use replace_metadata to get rid of it. But I've had to prepare different personal.ini for each fandom I download from because when I tried to have it for two fandoms in the same personal.ini I got an error message that it was too long. Ao3's freeformtags are also annoying sometimes when people use it for commentary instead of tagging, but because I did not want to prepare yet another personal.ini for that, I had to opt to using calibre's tag mapper for it.
edeniz is offline   Reply With Quote
Old 11-05-2015, 11:36 AM   #713
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,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I've added a new wiki page MetadataManagement and put a couple of my metadata settings in it. I think anyone with a GitHub account(free) can add to it.

Quote:
Originally Posted by edeniz View Post
I want to separate pairings and genre (ao3's freeformtags nothwithstanding) to its own column, and I think I've managed it. Only, the column is now empty. I'd like to get the tags needed from the metadata already downloaded into the tags column instead of burdening the servers with a probably unnecessary metadata download, but I'm not sure how to do so.
I can't help with your column being empty without specifics. If you've configured a 'Saved Metadata Column' (see bottom of 'Custom Columns' tab in FFF config), the plugin will have saved the metadata for each book you've downloaded/updated since saving that setting.

You can then use 'Update Calibre Metadata from Saved Metadata Column'. If any of the books you're updating don't have saved metadata, FFF will perform 'Update Calibre Metadata from Web Site' for them and save the metadata in the column.

Quote:
Originally Posted by edeniz View Post
...
There is only a limited amount of metadata replacing possible. (What's that number anyway?)
...
I've never seen such a limit. Can you post the error message it gives you and an example of a personal.ini that causes it?
JimmXinu is offline   Reply With Quote
Old 11-05-2015, 02:20 PM   #714
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
Quote:
Originally Posted by JimmXinu View Post
I've added a new wiki page MetadataManagement and put a couple of my metadata settings in it. I think anyone with a GitHub account(free) can add to it.



I can't help with your column being empty without specifics. If you've configured a 'Saved Metadata Column' (see bottom of 'Custom Columns' tab in FFF config), the plugin will have saved the metadata for each book you've downloaded/updated since saving that setting.

You can then use 'Update Calibre Metadata from Saved Metadata Column'. If any of the books you're updating don't have saved metadata, FFF will perform 'Update Calibre Metadata from Web Site' for them and save the metadata in the column.



I've never seen such a limit. Can you post the error message it gives you and an example of a personal.ini that causes it?

Well, I created the Pairings column to be "comma separated text, like tags, shown in the tag browser", with the lookup name pairings. Same with the Genre column, only with the lookup name genre. That's really the only info I can give about it. I didn't do anything special. But I guess that's moot because from what you've said I made a big mistake previously.


I had not configured a "saved metadata column". For some reason I never even saw that line in the fanficfare customization settings. Fixed it now.

Oh well. I'll have to do it manually then. After all, there are only a handful of stories with pairings in my as yet small library, and I want only the handful of main genres in my genre column anyway, so it shouldn't take too long.

As for the limit thing, I'm attaching the personal.ini like you said. And a screenshot of the error message, since it's too long and I can't find a log of it (if it exists).
Attached Files
File Type: zip error.zip (262.8 KB, 210 views)
edeniz is offline   Reply With Quote
Old 11-05-2015, 03:07 PM   #715
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,974
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by edeniz View Post
As for the limit thing, I'm attaching the personal.ini like you said. And a screenshot of the error message, since it's too long and I can't find a log of it (if it exists).
I don't know why you started with a copy of defaults.ini. That will occasionally cause problems when you don't pick up changes made to defaults.ini because you're already overriding them.

The problem is this bad line, not any arbitrary length limit:
Code:
 characters=>Ameyuri R\.=>=>Ringo Ameyuri&&category=>Naruto&&category=>Naruto
But the error message is vague, so I can see why you came to that conclusion. I'll try to improve it.

(FYI, you have several lines in your replace_metadata there that are character instead of characters.)
JimmXinu is offline   Reply With Quote
Old 11-05-2015, 03:25 PM   #716
DavidTC
Connoisseur
DavidTC began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Sep 2011
Device: Nook, Boox C67ML
Quote:
Originally Posted by JimmXinu View Post
I've posted a new Test version (direct link) that fixes the problem you reported as well as adding sort_ships_splits and ships_CHARS features.

As requested, you can use replace_metadata on ships_CHARS to operate on the individual parts of ships entries while they are split.

You can use sort_ships_splits to specify more than one regular expression to use to split by and what string to use to join the char parts back together after sorting.
This all seems to be working. Thanks. I'm tracing down various ships of different lists and orders, making sure the regexps line up, and then updating, and it all seems to working correctly.

Quote:
Originally Posted by JimmXinu View Post
Please do. I'd be happy to put a page under the project wiki for it. (I think anyone with a GitHub account can edit wiki pages.) I've asked before for the people who spend lots of time normalizing tags to share their work with little result.
Great! I'll start trying to collect some of my more generic ones, and put them up. (Fun fact: AO3 tags for characters often include the word (Character) after them. Yeah, uh, thanks AO3, I was confused as to what tag that was in the *character* list.)

Then I can put some fandom-specific ones, I guess. That's going to be a bit more subjective, but I guess most people would be okay going to full names, and if not, that's easy enough for them to change without having to deal with the regexp, which is the most complicated part.
DavidTC is offline   Reply With Quote
Old 11-05-2015, 03:31 PM   #717
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
Quote:
Originally Posted by JimmXinu View Post
I don't know why you started with a copy of defaults.ini. That will occasionally cause problems when you don't pick up changes made to defaults.ini because you're already overriding them.
I did that because I thought this would make it easier for me to compare it to defaults.ini whenever it updates. Thought I'd just highlight the differences and compare. If it doesn't work someday for me or becomes cumbersome I'll trim it down. For now it works.


Quote:
The problem is this bad line, not any arbitrary length limit:
Code:
 characters=>Ameyuri R\.=>=>Ringo Ameyuri&&category=>Naruto&&category=>Naruto
But the error message is vague, so I can see why you came to that conclusion. I'll try to improve it.

(FYI, you have several lines in your replace_metadata there that are character instead of characters.)

Oh, I see. Thank you!

At first I went over it several times, to see if there was an error in there somewhere, but somehow never picked up on those lines. That and the error message telling me it was too long is why I thought there was a length limit. And so I cut off most of it, leaving only the most often used ones. Guess I removed also those bad lines when I did that, so I never noticed it wasn't a length limit that was the problem.


Forgot to say this before: Thank you for the link to the wiki page, I'll be certain add my tags to the list. I think it's awesome and very helpful that people are pooling their tag change regex together.

Last edited by edeniz; 11-05-2015 at 03:34 PM.
edeniz is offline   Reply With Quote
Old 11-05-2015, 04:27 PM   #718
Montana Harper
book geek (she/her)
Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.Montana Harper ought to be getting tired of karma fortunes by now.
 
Montana Harper's Avatar
 
Posts: 115
Karma: 2029154
Join Date: Sep 2013
Location: Pacific Northwest
Device: iPhone 16 Pro Max, Kindle Paperwhite (10th gen)
Quote:
Originally Posted by DavidTC View Post
(Fun fact: AO3 tags for characters often include the word (Character) after them. Yeah, uh, thanks AO3, I was confused as to what tag that was in the *character* list.)
As I understand it, that happens when there are identical tags in multiple categories. For instance, you can have Harry Potter as a fandom name, but also Harry Potter as a character name. There has to be a way to differentiate the two, and AO3 has chosen to add an identifier like that. You'll also find "- Fandom" after some tags.
Montana Harper is offline   Reply With Quote
Old 11-05-2015, 04:50 PM   #719
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by edeniz View Post
I did that because I thought this would make it easier for me to compare it to defaults.ini whenever it updates. Thought I'd just highlight the differences and compare. If it doesn't work someday for me or becomes cumbersome I'll trim it down. For now it works.
The best way to compare changes to the defaults is to take a look at the file's revision history: https://github.com/JimmXinu/FanFicFa...n-defaults.ini

(FanFicFare repo --> Select file --> click "History")
eschwartz is offline   Reply With Quote
Old 11-05-2015, 05:11 PM   #720
edeniz
Zealot
edeniz began at the beginning.
 
Posts: 132
Karma: 10
Join Date: Oct 2015
Device: Sony Reader, Tolino Shine, Samsung Galaxy S3
Quote:
Originally Posted by eschwartz View Post
The best way to compare changes to the defaults is to take a look at the file's revision history: https://github.com/JimmXinu/FanFicFa...n-defaults.ini

(FanFicFare repo --> Select file --> click "History")
Thank you! I hadn't realized. I still keep finding out new things about fanficfare and calibre that I didn't know (and half the time those seem to be common sense *sigh*).
edeniz 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:12 PM.


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