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 Yesterday, 10:00 AM   #11866
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: 7,380
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by eb21145 View Post
Back with another question with a probably very obvious solution: I'm trying to clean up the freeform tags that are populating in my custom AO3 column and I'm running into a problem where if a tag that was not initially excluded when the fic was first downloaded/loaded into Calibre is now excluded AND it's the only tag left in the column, Calibre won't delete the tag and leave the freeformtags column empty when I update the metadata.
custom_columns_settings 'r' (for replace) mode doesn't call set_custom() if there's no value to set. So it never clears a column. It's been that way for at least 10 years, so I'm reluctant to change it now.

(The FFF Custom Columns GUI setting, OTOH, does set empty values, but only knows about the 'standard' FFF metadata entries.)

You might consider clearing that column in mass and then using 'Update from Saved Metadata'.

I might consider adding another 'mode' for custom_columns_settings -- maybe 'R' for really replace. Would anyone else find that useful?
JimmXinu is offline   Reply With Quote
Old Yesterday, 01:20 PM   #11867
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 172
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
This ([^/&]+) worked mostly great.

There were a couple issues.

When dealing with more than two names and the '&' sign, it would mess up on configurations I didn't specify. I'm not even sure how I'm getting those.

ie. Moon & Sun & Reader became Moon & Reader& Sun

I'm not sure if there is an easier way to fix this, but I added this code:

Code:
 ships=>(?<! )(&amp;)=> \1
Another thing is my code struggles with names containing multiple parentheses, breaking the pairing up. Instead of Thor/Michael turning into Thor (Norse Mythology)/Michael (Supernatural) and Michael (Supernatural)/Thor (Norse Mythology), I get two separate entries. ie Michael (Supernatural) as one pairing and Thor (Norse Mythology) as another.


I don't know how to fix it and I already have two urls affected (https://archiveofourown.org/works/11...pters/27110763), (https://archiveofourown.org/works/57...pters/13190308).

My code:
Code:
 category,characters,ships,genre=> \(.*\)=>
 category=>Religion &amp; Lore=>Mythology
 
 characters,ships=>(Þórr \| )?Thor=>Thor (Norse Mythology)&&category=>Norse Mythology
 characters,ships=>Gabriel=>Gabriel (Supernatural)&&category=>Supernatural
 characters,ships=>(?<!\()Lucifer( Morningstar)?=>Lucifer\1 (Supernatural)&&category=>Supernatural
 characters,ships=>Michael=>Michael (Supernatural)&&category=>Supernatural


####################
###        SHIPS         ###
###  EXCEPTIONS  ###
####################

### 4 names (name1/name2/name3/name4)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\1\2\3\4\5\6\7\,\3\2\5\4\7\6\1\,\5\2\7\4\1\6\3\,\7\2\1\4\3\6\5

### 3 names (name1/name2/name3)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\1\2\3\4\5\,\3\2\5\4\1\,\5\2\1\4\3

### 2 names (name1/name2)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)=>\3\2\1\,\1\2\3

 ships=>(?<! )(&amp;)=> \1

##Make sure certain names are not first

### 3 names (name1/name2/name3)
 ships=>^(Chloe Decker)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\3\2\5\4\1
 ships=>^(Elena Gilbert)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\3\2\5\4\1

### 2 names (name1/name2)
 ships=>^(Chloe Decker)(/| &amp; )([^/&]*)$=>\3\2\1  
 ships=>^(Elena Gilbert)(/| &amp; )([^/&]*)$=>\3\2\1  

 ships=>^(Original .+ Character)(/| &amp; )([^/&]*)$=>\3\2\1
Jade Aislin is offline   Reply With Quote
Old Yesterday, 05:16 PM   #11868
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: 7,380
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by Jade Aislin View Post
This ([^/&]+) worked mostly great.

There were a couple issues.

When dealing with more than two names and the '&' sign, it would mess up on configurations I didn't specify. I'm not even sure how I'm getting those.

ie. Moon & Sun & Reader became Moon & Reader& Sun

I'm not sure if there is an easier way to fix this, but I added this code:

Code:
 ships=>(?<! )(&amp;)=> \1
If that works for you. The atomic group feature appears to be new in Python version 3.11 and I confess I haven't used it before.

My instinct would be to exclude the spaces and then add them back, something like this (warning untested code):
Code:
### 4 names (name1/name2/name3/name4)
 ships=>^([^/&]+) *(/|&amp;) *([^/&]+) *(/| &amp; ) *([^/&]+) *(/|&amp;) *([^/&]+)$=>\1\2\3\4\5\6\7\,\3\2\5\4\7\6\1\,\5\2\7\4\1\6\3\,\7\2\1\4\3\6\5
## 3 & 2 are similar.  \s is an explicit spaces  (The config parser
## tends to discard trailing spaces.)
 ships=>(&amp;)=> \1\s
That will also match Alice&Bob ships, because AO3 doesn't actually enforce spaces around & as far as I know.

Quote:
Originally Posted by Jade Aislin View Post
Another thing is my code struggles with names containing multiple parentheses, breaking the pairing up. Instead of Thor/Michael turning into Thor (Norse Mythology)/Michael (Supernatural) and Michael (Supernatural)/Thor (Norse Mythology), I get two separate entries. ie Michael (Supernatural) as one pairing and Thor (Norse Mythology) as another.


I don't know how to fix it and I already have two urls affected (https://archiveofourown.org/works/11...pters/27110763), (https://archiveofourown.org/works/57...pters/13190308).

My code:
Spoiler:
Code:
 category,characters,ships,genre=> \(.*\)=>
 category=>Religion &amp; Lore=>Mythology
 
 characters,ships=>(Þórr \| )?Thor=>Thor (Norse Mythology)&&category=>Norse Mythology
 characters,ships=>Gabriel=>Gabriel (Supernatural)&&category=>Supernatural
 characters,ships=>(?<!\()Lucifer( Morningstar)?=>Lucifer\1 (Supernatural)&&category=>Supernatural
 characters,ships=>Michael=>Michael (Supernatural)&&category=>Supernatural


####################
###        SHIPS         ###
###  EXCEPTIONS  ###
####################

### 4 names (name1/name2/name3/name4)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\1\2\3\4\5\6\7\,\3\2\5\4\7\6\1\,\5\2\7\4\1\6\3\,\7\2\1\4\3\6\5

### 3 names (name1/name2/name3)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\1\2\3\4\5\,\3\2\5\4\1\,\5\2\1\4\3

### 2 names (name1/name2)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)=>\3\2\1\,\1\2\3

 ships=>(?<! )(&amp;)=> \1

##Make sure certain names are not first

### 3 names (name1/name2/name3)
 ships=>^(Chloe Decker)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\3\2\5\4\1
 ships=>^(Elena Gilbert)(/| &amp; )([^/&]+)(/| &amp; )([^/&]+)$=>\3\2\5\4\1

### 2 names (name1/name2)
 ships=>^(Chloe Decker)(/| &amp; )([^/&]*)$=>\3\2\1  
 ships=>^(Elena Gilbert)(/| &amp; )([^/&]*)$=>\3\2\1  

 ships=>^(Original .+ Character)(/| &amp; )([^/&]*)$=>\3\2\1
NGL, I'm confused, too.

If you remove the '(' ')' chars from the lines for Thor and Gabriel , they become "Thor Norse Mythology Norse Mythology" and "Gabriel Supernatural Supernatural". The first line " \(.*\)=>" is masking that.

There's weirdness going on and honestly, I can't be bothered to figure out exactly what.

But I do have a solution that will also address a problem you haven't mentioned yet, at the 'expense' of sorting the ships--which you're then duplicating anyway, so I don't see the harm.
Code:
## Turned on so ships_CHARS is available.
sort_ships:true
# use ships_CHARS everywhere you want to affect a person in the ship.

replace_metadata:
 category,characters,ships_CHARS,genre=> \(.*\)=>
 category=>Religion &amp; Lore=>Mythology

# Add ^ and $ around every ship char you want to change--
# otherwise you'll also change Thorn, Michael Landon, etc
 characters,ships_CHARS=>^(Þórr \| )?Thor$=>Thor (Norse Mythology)&&category=>Norse Mythology
 characters,ships_CHARS=>^Gabriel$=>Gabriel (Supernatural)&&category=>Supernatural
 characters,ships_CHARS=>^(?<!\()Lucifer( Morningstar)?$=>Lucifer\1 (Supernatural)&&category=>Supernatural
 characters,ships_CHARS=>^Michael$=>Michael (Supernatural)&&category=>Supernatural

# ...

## needs a trailing '$' also, otherwise it affects the 4 & 3 count lines.
### 2 names (name1/name2)
 ships=>^([^/&]+)(/| &amp; )([^/&]+)$=>\3\2\1\,\1\2\3
I believe you've been here long enough to have seen my rant on the ultimate futility of wrangling AO3 tags, so we can take it as read, yes?
JimmXinu is offline   Reply With Quote
Old Yesterday, 07:23 PM   #11869
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,728
Karma: 81469865
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Is there any difference between using ePubMerge on some already-downloaded fanfics and using FFF to download an anthology?
ownedbycats is offline   Reply With Quote
Old Yesterday, 07:57 PM   #11870
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,728
Karma: 81469865
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Glitch:

Set Calibre Series URL concatenates the URLs of every series present in an anthology.
ownedbycats is offline   Reply With Quote
Old Yesterday, 10:33 PM   #11871
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: 7,380
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by ownedbycats View Post
Is there any difference between using ePubMerge on some already-downloaded fanfics and using FFF to download an anthology?
FFF Anthology, depending on site (ie, AO3) will collect series status and description.
Quote:
Originally Posted by ownedbycats View Post
Glitch:

Set Calibre Series URL concatenates the URLs of every series present in an anthology.
Example story URL?
JimmXinu is offline   Reply With Quote
Old Yesterday, 11:01 PM   #11872
eb21145
Junior Member
eb21145 began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Apr 2026
Device: Kindle
Quote:
Originally Posted by JimmXinu View Post
custom_columns_settings 'r' (for replace) mode doesn't call set_custom() if there's no value to set. So it never clears a column. It's been that way for at least 10 years, so I'm reluctant to change it now.
Shoot, thought it might be something like that. Well I was planning to do a mass clean out than redownload from the saved metadata anyway.

Thanks!
eb21145 is offline   Reply With Quote
Old Today, 08:40 AM   #11873
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,728
Karma: 81469865
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by JimmXinu View Post
Example story URL?
For example, three stories from a series, the Calibre Series URL comes out as
Code:
https://archiveofourown.org/series/4838692,%20https://archiveofourown.org/series/4838692,%20https://archiveofourown.org/series/4838692
and 404s. It adds another for each story in the anthology.
ownedbycats is offline   Reply With Quote
Old Today, 08:55 AM   #11874
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: 7,380
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
Quote:
Originally Posted by ownedbycats View Post
For example, three stories from a series, the Calibre Series URL comes out as
Code:
https://archiveofourown.org/series/4838692,%20https://archiveofourown.org/series/4838692,%20https://archiveofourown.org/series/4838692
and 404s. It adds another for each story in the anthology.
Please provide a (SFW) story URL that exhibits the problem when asking for help.

EDIT: If you mean you are downloading an FFF anthology for 3 of the 128 books in https://archiveofourown.org/series/4838692, I'm not seeing that happen.

My only guess would be that you are doing replace_metadata on the seriesUrl changing it into a list?

Last edited by JimmXinu; Today at 08:59 AM.
JimmXinu is offline   Reply With Quote
Old Today, 09:38 AM   #11875
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,728
Karma: 81469865
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Except for some conditionals, these are only refs to seriesURL in personal.ini:

Code:
include_in_series:series,collections
include_in_seriesUrl:seriesUrl

Not sure why I had the second one, tbh. I try removing.

EDIT: Didn't fix it.

Last edited by ownedbycats; Today at 09:42 AM.
ownedbycats is offline   Reply With Quote
Old Today, 01:11 PM   #11876
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: 7,380
Karma: 5007213
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
I put include_in_series:series,collections in and downloaded https://archiveofourown.org/series/4838692 as an anthology.

I'm not seeing anything unusual happen with seriesUrl, in the titlepage or putting series into custom column.
JimmXinu is offline   Reply With Quote
Old Today, 02:30 PM   #11877
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,728
Karma: 81469865
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
It's the Calibre Series URL that's affected, the link attached to series column.
ownedbycats 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 532 03-19-2026 12:30 PM
[GUI Plugin] Open With kiwidude Plugins 405 02-09-2026 07:54 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 03:34 PM.


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