07-16-2013, 01:31 PM | #1531 | |
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
Quote:
Code:
replace metadata: ships=> (&|and) (.*?)$=>/\2 (Friendship) ships=>&(.*?)$=>/\1 (Friendship) ships=> (&|and) =>/ ships=>&=>/ ships=>(( )?(x)( )?)=>/ Thanks for making this change, it's going to greatly reduce my personal ini. - Jade Aislin |
|
07-16-2013, 09:12 PM | #1532 |
Connoisseur
Posts: 62
Karma: 640495
Join Date: Jul 2012
Location: Germany
Device: Kindle Touch, Android smartphone w/ FBReader
|
Feature Request: Auto-apply Smarten Punctuation
Dear JimmXinu,
I have now more than 300 fanfics in my calibre collection, all downloaded with FFDL. It's probably among my most used calibre plug-ins at this point. I still love how easy this makes getting fanfics onto my Kindle. Yet there is still one irk I've been wondering if you could fix (dunno how hard to implement this would be): Almost all the fanfics I download don't have proper typography (and I am pretty OCD about that! ), so I routinely manually apply Smarten Punctuation via the great Polish Books feature calibre has had for a few months now. This can get pretty tedious, especially with updating still ongoing stories where if I forget to do this just once, the resulting AZW3/KF8 file will have the positions of all my notes and marks disarranged (The notes are positioned by absolute byte counts unfortunately. Srsly, Amazon? ). So could you integrate the Smarten Punctuation feature (and maybe others from Polish Books if there is a need with other users?) into FFDL like you did with the plug-ins Generate Cover, Reading List and Count Pages? So that I could, say, make FFDL routinely auto-apply Smarten Punctuation after every new download and/or overwrite-if-newer update of a fanfic ? That would rock! Cheers, MaxManuka. |
07-16-2013, 09:35 PM | #1533 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Dylan, are you running Polish Book before or after converting to AZW3/KF8?
There's a good chance I can call Polish Book from FFDL, but not after Convert. |
07-17-2013, 04:20 PM | #1534 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
This version can call Smarten Punctuation on each EPUB download/update. Look for the option on the Basic config tab.
It mildly messes up the Update Log for story summaries--the smartened summary may not match the actual summary and therefore it will be included every update. Let me know how this works for people. UPDATE Jul 18, 2013 - Remove obsolete beta versions Last edited by JimmXinu; 07-18-2013 at 12:54 PM. |
07-17-2013, 05:37 PM | #1535 |
Connoisseur
Posts: 62
Karma: 640495
Join Date: Jul 2012
Location: Germany
Device: Kindle Touch, Android smartphone w/ FBReader
|
It works!
Yes, I do apply Smarten Punctuation directly on the EPUB before converting.
I should have checked back on this thread earlier I guess! Sorry I didn't clarify. I shall test this immediately. Incidentally, one of the fanfics I follow has a new update out today. Let's see … … aaand it worked flawlessly \o/. No errors in the download log and the punctuation is smartened just like when I apply it manually. Jimm, thank you a lot for implementing this, and so quickly as well! :-) |
07-17-2013, 05:54 PM | #1536 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Great. Oh, I should also mention, that test version (2 posts back from this) has another new feature I've been playing with:
You can drag and drop story urls, text containing story urls, or even emails (like from Thunderbird) containing story urls onto the FFDL plugin button. And drag and drop existing books in the library onto it for update. It's very similar to how you d-n-d those onto the edit box in the Add dialog, but skips the step of opening the Add dialog first. |
07-18-2013, 12:29 PM | #1537 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Version 1.7.31 - 18 Jul 2013
|
07-18-2013, 01:02 PM | #1538 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Naturally, there's a new problem reported right after I post a new version.
thehexfiles.net allows HTML tags in story titles. Epub/calibre/etc don't allow that. Attached version strips out HTML from story titles (and author names) on thehexfiles.net. UPDATE Jul 23, 2013 - Remove obsolete beta versions Last edited by JimmXinu; 07-23-2013 at 04:28 PM. Reason: Remove obsolete beta versions |
07-19-2013, 03:01 PM | #1539 |
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
I seem to be having problems with the testing feature now. I copied the example Jim gave in a previous post. First I added the [test story:defaults], then I added the [test.com].
My code is: Code:
[test1.com] replace_metadata: ships=>(( )?(-)?( )?[Bb]rother(s)?(ly )?(love)?|( )?(-)?( )?[Ff]amil(y)?(ial)?( Relationship)?)=>\1 (Family) titlepage_entries: seriesHTML,tcategory,characters,ships,genre,warnings,status,numChapters,numWords,rating,datePublished,dateUpdated,description,site [teststory:1002] ships_list:brotherly love Spock/Kirk, Sess/Rin family, Ori/Dori Familial Relationship, Bilbo/Balin - Brothers |
07-19-2013, 06:27 PM | #1540 |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Jade,
Looks like I forgot to get all of the entries into the 'valid_entries' list on the default. Including ships. I'll add it to the next version, but in the meantime, you can add one more line to your config to tell it to allow ships in test stories: Code:
[teststory:1002] add_to_valid_entries:,ships_list |
07-20-2013, 01:16 AM | #1541 | |
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
Quote:
This is my code with my testing entries: Code:
[test1.com] replace_metadata: ships=>(( )?(-)?( )?[Bb]rother(s)?(ly )?(love)?|( )?(-)?( )?[Ff]amil(y)?(ial)?( Relationship)?)=> (Family) ships=>(\(Family\)|\(Friendship\))( )?(.*?)$=>\3 \1 [teststory:1002] add_to_valid_entries:,ships_list ships_list:brotherly love Spock/Kirk, Sess/Rin family, Ori/Dori Familial Relationship, Bilbo/Balin - Brothers, Thorin/Bilbo However when I tried it now, I got this: Ships: Balin (Family)/Bilbo, Bilbo/Thorin, Dori (Family)/Ori, Rin (Family)/Sess, Spock/Kirk (Family) It looks as though when the keywords for my tag is at the end, it is able to sort the ships. The only ship that didn't get sorted had keywords before the ship, although the tag did get placed at the end. When the ships sorted, it sorted the tag as well. Is there any way to get the end tag (Family) at the end, even when the ship is sorted? |
|
07-20-2013, 11:22 AM | #1542 | |
Plugin Developer
Posts: 6,317
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
Yes, your family/etc tags are being included in the sort. It's just a string as far as the code is concerned; "Rin family" or "Rin (Family)" is no different from "Rin Smith". However, you should be able to put your 'tags' at the end using replace_metadata with ships_LIST. Match "(Family|etc) name/other name" and swap it around. Keep in mind that you're dealing with the whole list at that point, you can match on the commas between and end of string. If there are commas in any of the names it will cause problems, but could that be handled by changing join_string_ships and reverting it afterwards with another ships_LIST regex. (Or by removing commas before all your processing probably a better solution for calibre tag-like columns.) You'll also need additional complexity for 3, 4, 5, etc ways if you want those to work the same. |
|
07-21-2013, 02:44 AM | #1543 | ||
Groupie
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
|
Quote:
Code:
replace_metadata: ships=>(( )?(-)?( )?[Bb]rother(s)?(ly )?(love )?|( )?(-)?( )?[Ff]amil(y)?(ial)?( Relationship)?( )?)=> (Family) ships=> \(Family\)(.*?)$=>\1 (Family) Quote:
I now have this code: Code:
replace_metadata: #Convert keywords to end tags. ships=>(( )?(-)?( )?[Bb]rother(s)?(ly )?(love )?|( )?(-)?( )?[Ff]amil(y)?(ial)?( Relationship)?( )?)=> (Family) #Place the end tag at the end of the ship. ships=> \(Family\)(.*?)$=>\1 (Family) #sort the names in the ships (code is in the default for all sites) #Place the end tag at the end of the ship using ships_LIST ships_LIST=>(\(Family\)|\(Friendship\))( )?(.*?),=>\3 \1, ships_LIST=>,(.*?)( \(Family\)|\(Friendship\))/(.*?)$=>,\1/\3\2 #get rid of space before the '/' ships_LIST=> /=>/ Next up, reworking the code to separate ships with more than one end tag into their own ships (ie: A/B (Friendship) (Past), becomes: A/B (Friendship), A/B (Past).) I'm hoping it will be as simple as using the code I had for ships with a comma at the beginning of the regex. However, I'll work on that another day. I'm actually proud of myself. I rewrote this message three or four times because I figured out how to fix my problems with putting the end tag at the end. Thanks for all the help. |
||
07-21-2013, 12:54 PM | #1544 |
Member
Posts: 10
Karma: 10
Join Date: Jul 2013
Device: kindle fire and other android
|
ff plugin -- fanfiktion.de
Hello
I have a little problem. We like to get the stories from "fanfiktion.de" with the calibre plugin. But since about two weeks the plugin doesn't accept the URLs from the german site. (no problems with fanfiction.net) I have installed calibre and the plugin 1.7.31 on a new win7 pc und there is the same problem. Perhaps you can help us. |
07-21-2013, 06:05 PM | #1545 |
Occassional Beta Tester
Posts: 283
Karma: 3516
Join Date: Nov 2010
Location: Hungary
Device: Samsung Galaxy Tab 4 (wifi only)
|
Jimm,
please check this: http://www.fanfiktion.de/s/4e74e42f0001c5040650ea60/1 I got a 'NoneType' object has no attribute 'string' error |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Count Pages | kiwidude | Plugins | 1750 | 04-07-2024 01:20 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[GUI Plugin] Resize Cover | kiwidude | Plugins | 95 | 03-16-2024 11:55 PM |
[GUI Plugin] Find Duplicates | kiwidude | Plugins | 1096 | 03-16-2024 11:28 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |