View Single Post
Old 03-15-2013, 07:03 PM   #1237
seabream
Enthusiast
seabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheeseseabream can extract oil from cheese
 
Posts: 48
Karma: 1056
Join Date: Jul 2012
Location: Central Canada
Device: Sony PRS-T1, RIM Playbook & Z10, Samsung Note, MacOSX
I’m having three categories of difficulty:
reviews/favs/follows >3 digits long, strings containing “()” and strings containing “&”.

I’m using Mac OS 10.7.5, calibre 0.9.22, and Fanfiction Downloader 1.7.12

1) I’ve got custom columns for reviews/favs/follows on Fanfiction.net. I formatted them the same way that the instructions for the Count Pages plugin tells us to format the custom columns for “words” and “pages” i.e.: {0:,}
When the number of reviews (or favs or follows) is shorter than four digits, this works fine, when there are more, I get : “invalid literal for int() with base 10: ‘1,276’” where 1,276 is the number of reviews in question. Does FanFiction Downloader handle numbers differently than Count Pages does? Apologies if this counts as a silly question to someone who knows what the formatting means. I looked in http://docs.python.org/2/library/string.html, and failed to find an answer.
Sample link for a shortish story: http://www.fanfiction.net/s/6483644/1/
Also note, that other custom columns settings after reviews were aborted. Meaning, that the numerical ones showed undefined, despite being shorter than four digits, and assorted replacements that would normally happen didn’t.

2) With round brackets in fandoms and character names on AO3, I haven’t been able to get anything to work successfully. I’ve tried \(, [(] and even .* for the segment containing the brackets e.g.:
characters=>(^Henry.*$)=>Henry Mills&&category=>Once Upon a Time.*
to try to get character and variants: “Henry (Once Upon a Time)” on stories in fandom: “Once Upon a Time (TV)”
In all cases, it’s as though the line doesn’t exist.
Here’s a sample story link: http://archiveofourown.org/works/545044

3) I’m doing a character format replacement that works fine in fandoms without an &, and weirdly for one that does.
So here’s a working example with site: fanfiction.net, fandom: Pitch Perfect, character Chloe B., and a non-working one with fanfiction.net, fandom: Rizzoli & Isles, character: Jane R.

I have four places I want characters to show up: 1) Tags, 2) #characters custom column, 3) Titlepage, 4) logpage.

In Tags (1), I want the format “ch fandom: character” (e.g.: ch Pitch Perfect: Chloe Beale), in the other three I want “fandom.character” (e.g.: Pitch Perfect.Chloe Beale)

I’ve got this to work by having:

extra_valid_entries:edchars
edchars_label: Characters by fandom
include_in_edchars:characters

custom_columns_settings:
edchars=>#characters,n

replace_metadata:
characters=>(^Chloe B\.$)=>Chloe Beale&&category=>Pitch Perfect
characters=>(.+)=>ch Pitch Perfect: \1&&category=>Pitch Perfect
edchars=>(ch Pitch Perfect: )=>Pitch Perfect.
characters=>J\. Rizzoli=>Jane Rizzoli&&category=>Rizzoli & Isles
characters=>(.+)=>ch Rizzoli & Isles: \1&&category=>Rizzoli & Isles
edchars=>(ch Rizzoli & Isles: )=>Rizzoli & Isles.

and putting edchars into tittlepage_entries and extra_logpage_entries

For fandoms without an & this works fine. For some reason, with Rizzoli & Isles, it doesn’t.

I can’t get the four to match up correctly.
a) if edchars=>(ch Rizzoli & Isles: )=>Rizzoli & Isles.
I get 1, 3, 4, right, and 2 wrong, i.e.: 1 and 2 prints “ch fandom: character”, and 3 and 4 shows “fandom.character”
b) if edchars=>(ch Rizzoli & Isles: )=>Rizzoli & Isles.
I get 1, 2, 3, 4 right, but the title page doesn’t show in the book details, or if there is already a title page, it doesn’t update properly.
c) if edchars=>(ch Rizzoli & Isles: )=>Rizzoli & Isles.
I get 1 and 2 right, and 3 and 4 wrong. i.e.: 1, 3, 4, as “ch fandom: character” and 2 as “fandom.character”
d) if edchars=>(ch Rizzoli & Isles: )=>Rizzoli & Isles.
I get the same results as c.

Why? And how do I fix it?

Here’s a sample link for Rizzoli & Isles: http://www.fanfiction.net/s/8813042/1/
Here’s a sample link for Pitch Perfect: http://www.fanfiction.net/s/8770999/

Last edited by seabream; 03-15-2013 at 07:05 PM. Reason: accidentally had a - instead of a _
seabream is offline