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 01-16-2023, 10:48 AM   #7951
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: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
The replace_metadata for this fic is giving me a bit of hassle.

Half-Life (Video Games), Game: Black Mesa (Half-Life) - Fandom

Code:
replace_metadata:

 category=> \([0-9]+\)| \(Video Game\)| \(Video Games\)| (|- Fandom\(Movies\)|\(Movie [0-9]+\)| \(Comics\)| \(TV\))$=>
 category=>(Half-Life: Decay|Hunt Down The Freeman|Half-Life 2|Half-Life Opposing Force|Half-Life: Alyx|Half Life|Game: Black Mesa \(Half-Life\))=>Half-Life
gives me: Crossover, Half-Life, Half-Life - Fandom

The "Black Mesa (Half-Life)" bit got replaced as expected, but why didn't " - Fandom" get removed by the first line?

Last edited by ownedbycats; 01-16-2023 at 10:51 AM.
ownedbycats is offline   Reply With Quote
Old 01-16-2023, 11:05 AM   #7952
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
Because the pattern matches - Fandom\(Movies\) but not - Fandom.

If your intention is reduce all variants of Half-Life to just Half-Life, rather than matching each variant, you could do:
Code:
replace_metadata:
 ^.*(Half-Life).*$=>\1

# case insensitive version, match half-life, Half-life, half-lIFE, etc
replace_metadata:
 (?i)^.*(Half-Life).*$=>Half-Life
JimmXinu is offline   Reply With Quote
Advert
Old 01-16-2023, 11:08 AM   #7953
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: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Oops. I see that now. I think my brain transposed the characters while I was looking at it.

Would changing it to "Half.Life" also capture that one "Half Life" in there?

EDIT: Actually no, it'd put "Half Life" back. I'll put it in the other replacement regex for the extra stuff (Black Mesa, Hunt Down the Freeman).

Last edited by ownedbycats; 01-16-2023 at 08:09 PM.
ownedbycats is offline   Reply With Quote
Old 01-16-2023, 01:44 PM   #7954
marshie250
Enthusiast
marshie250 began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jun 2019
Device: Kobo
With an anthology, is it possible to, instead of averaging the kudos count, take only the highest kudos count from one of the stories?

Or along a similar vein, can you pull the most recent update date instead of the update date from the newest installment? Sometimes authors update stories within their anthologies out of order, so the calibre "update" date isn't always accurate.
marshie250 is offline   Reply With Quote
Old 01-16-2023, 03:49 PM   #7955
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by JimmXinu View Post
Because the pattern matches - Fandom\(Movies\) but not - Fandom.

If your intention is reduce all variants of Half-Life to just Half-Life, rather than matching each variant, you could do:
Code:
replace_metadata:
 ^.*(Half-Life).*$=>\1

# case insensitive version, match half-life, Half-life, half-lIFE, etc
replace_metadata:
 (?i)^.*(Half-Life).*$=>Half-Life
Hi, is there a guide on regex that you use in FanFiction downloader? I read through the Calibre regex tutorial and I didn't see the use of "\1" so I'm not sure what that does.

Thanks,
Amalthia
Amalthia is offline   Reply With Quote
Advert
Old 01-16-2023, 06:10 PM   #7956
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: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Take a look at this:
https://regex101.com/r/BgWNVN/1

Note that the regex captures all three examples, but only "Half-Life" is in the capture group. In a regex substitution, \1 simply puts the selected group back in.
ownedbycats is offline   Reply With Quote
Old 01-16-2023, 08:52 PM   #7957
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by ownedbycats View Post
Take a look at this:
https://regex101.com/r/BgWNVN/1

Note that the regex captures all three examples, but only "Half-Life" is in the capture group. In a regex substitution, \1 simply puts the selected group back in.
Thanks! I've been using some of these codes with no clue why the worked.
Amalthia is offline   Reply With Quote
Old 01-16-2023, 10:16 PM   #7958
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: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
regex101 has helped me a lot to the point where (with permission) I added it to this page.
ownedbycats is offline   Reply With Quote
Old 01-16-2023, 11:01 PM   #7959
Amalthia
Wizard
Amalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beautyAmalthia does all things with Zen-like beauty
 
Amalthia's Avatar
 
Posts: 1,188
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
Quote:
Originally Posted by ownedbycats View Post
regex101 has helped me a lot to the point where (with permission) I added it to this page.
Awesome tool! I had no idea this existed. I'm definitely bookmarking the site.
Amalthia is offline   Reply With Quote
Old 01-16-2023, 11:56 PM   #7960
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 marshie250 View Post
With an anthology, is it possible to, instead of averaging the kudos count, take only the highest kudos count from one of the stories?

Or along a similar vein, can you pull the most recent update date instead of the update date from the newest installment? Sometimes authors update stories within their anthologies out of order, so the calibre "update" date isn't always accurate.
I assume we're talking about for custom_columns_settings here?

No. You can have the sum (default), or the average, but that's all under the current code.

Are there other users who'd like a 'highest' option for anthologies and numeric custom columns?


FFF should be using the newest (or greatest) dateUpdated value from all included stories for the anthology's dateUpdated value, not the last in the last.

If you have an example of an anthology that doesn't, please post the URL (or PM to me if NSFW).
JimmXinu is offline   Reply With Quote
Old 01-17-2023, 04:59 PM   #7961
marshie250
Enthusiast
marshie250 began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jun 2019
Device: Kobo
I just rechecked the anthology I had in mind, and it looks like I misread the date--that's on me!

And yes, I was referring to the custom columns settings. I was thinking that a "highest" option would be valuable when sorting by kudos count, as some anthologies have a main, high-rated story with a much lower one-off that drives down the average, but a sum would throw off the comparison with anthologies with many equally-rated stories.
marshie250 is offline   Reply With Quote
Old 01-17-2023, 10:31 PM   #7962
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
New Test Version Posted

2023-01-17
- Add r_anthmax/n_anthmax options for custom_columns_settings
- Fixed the Deviantart adapter not detecting that a Deviation is Marked as needing a login, thanks bugmaschine
JimmXinu is offline   Reply With Quote
Old 01-18-2023, 06:06 PM   #7963
marshie250
Enthusiast
marshie250 began at the beginning.
 
Posts: 32
Karma: 10
Join Date: Jun 2019
Device: Kobo
The r_anthmax option worked beautifully; thank you!
marshie250 is offline   Reply With Quote
Old 01-20-2023, 05:32 AM   #7964
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: 10,993
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Small encoding bug?

When downloading this oneshot, the title of the only chapter (not the fic title in general) ends up as"Fire &; Ice"
ownedbycats is offline   Reply With Quote
Old 01-20-2023, 11:02 AM   #7965
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
2023-01-20
- Fix for & in chapter title.


A workaround for a workaround that apparently isn't always needed.
JimmXinu 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 11:46 AM.


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