Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-28-2024, 08:45 AM   #121
iakrus
Member
iakrus began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Aug 2024
Device: kobo sage
Quote:
Originally Posted by culytera View Post
You can't directly add onto a custom_column via replace_metadata, you'd need add_to_custom_columns_settings for that. But since you also want to have different data on #mycollections, you'll need to make another extra entry where you'll add the value from category. Here's how I would do that:

Code:
add_to_extra_valid_entries:,category_modified
include_in_category_modified:category

replace_metadata:
 category_modified=>House of the Dragon (TV)=>House of the Dragon

add_to_custom_columns_settings:
 category_modified=>#mycollections
thank you so so much for this!!! there are a few problems but its put me massively in the right direction and id never have figured this out on my own!

so, while fiddling with the code you gave me i have discovered that:

Code:
 category_modified=>Star Wars - All Media Types|Star Wars Original Trilogy|Star Wars Prequel Trilogy=>Star Wars

 category_modified=>Star Wars - All Media Types=>Star Wars
 category_modified=>Star Wars Original Trilogy=>Star Wars
 category_modified=>Star Wars Prequel Trilogy=>Star Wars
all work the same! im adding this in case someone has the same problem i have and comes looking for answers.

the real problem is that any ao3 fandom name with a character that gets used in code doesnt work. for example "Game of Thrones (TV)" has brackets, and "A Song of Ice and Fire & Related Fandoms" has the & ampersand. therefore, they are not read correctly and instead of modifying to the new column name i wanted, just copy themselves over in full.

i included those star wars examples because "Star Wars: The Clone Wars (2008) - All Media Types" and "Star Wars Legends: The Old Republic (Video Game)" and "Star Wars Legends: Republic (Comics)" don't work.

ive included colour coded images to show what i mean. i added harry potter after the first screenshot to see if crossovers work (they do!).

i hope theres a way to fix this- i tried putting the fandom names in quotation marks but that didnt work.
even if this is as much as we can do, it already fixed the problem i was having with the generate cover plug in, and manually editing out metadata is way easier than typing it in each time!!
so yeah, thanks!
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2024-09-28 130406.png
Views:	120
Size:	24.6 KB
ID:	211078   Click image for larger version

Name:	Screenshot 2024-09-28 131110.png
Views:	116
Size:	153.5 KB
ID:	211079  
iakrus is offline   Reply With Quote
Old 09-28-2024, 09:36 AM   #122
culytera
Zealot
culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.
 
Posts: 133
Karma: 295674
Join Date: Jul 2021
Device: iPhone
Ah I forgot, the parentheses need to be escaped since they have their own function in regex, so:

Code:
replace_metadata:
 category_modified=>House of the Dragon \(TV\)=>House of the Dragon
As for the ampersands, you might need to change them to & so:

Code:
replace_metadata:
 category_modified=>A Song of Ice and Fire & Related Fandoms=>ASOIAF | GOT
culytera is offline   Reply With Quote
Old 05-28-2025, 11:54 AM   #123
beecasso
stalker
beecasso began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2013
Device: pocketbook touch lux 5
Hey everyone, this thread has been a great help to me, thank you!
And I know this thread is old, but…
Is there a way to put multiple series on the cover and/or titlepage?
beecasso is offline   Reply With Quote
Old 06-11-2025, 06:17 PM   #124
chicleeblair
Connoisseur
chicleeblair began at the beginning.
 
Posts: 97
Karma: 10
Join Date: Sep 2018
Device: iPad mini
I've asked something like this before, but whatever the answer was isn't working. Is there a way to pull the number of words in the newest chapter? Either by subtraction or data on the site? AO3 has the chapter word count in emails, so it has to be somewhere.

I want to put it in a column, and also in the summary so it's easier to scroll on my ereader and compare, say, length of a one-shot to a new chapter of another fic when I don't have much time.
chicleeblair is offline   Reply With Quote
Old 06-11-2025, 07:13 PM   #125
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,191
Karma: 77899461
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
You can copy the old wordcount to another column before update and then use a Calibre template to compare it to the new one.
ownedbycats is offline   Reply With Quote
Old 06-11-2025, 10:19 PM   #126
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,191
Karma: 77899461
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Alternately, Reading Goal might be useful here as it keeps track of read pages. Not easily accessible to columns though.
ownedbycats is offline   Reply With Quote
Old 06-14-2025, 12:24 PM   #127
chicleeblair
Connoisseur
chicleeblair began at the beginning.
 
Posts: 97
Karma: 10
Join Date: Sep 2018
Device: iPad mini
Quote:
Originally Posted by ownedbycats View Post
You can copy the old wordcount to another column before update and then use a Calibre template to compare it to the new one.
Manually?
chicleeblair is offline   Reply With Quote
Old 06-14-2025, 12:27 PM   #128
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,191
Karma: 77899461
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Manually, or an action chain might be able to do it.
ownedbycats is offline   Reply With Quote
Old 09-12-2025, 10:48 PM   #129
elzzzz
Junior Member
elzzzz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2025
Device: iPad/Kindle
Multi Pair priorities questions

Quote:
Originally Posted by culytera View Post
What kind of look do you want to achieve? I shared my config in this thread before though the ini is slightly outdated. The only significant change is the background color changing depending on the rating. And since I only use AO3 I don't know how well my config will work with other sites. Here's my ini:
Spoiler:

Code:
[defaults]
replace_xbr_with_hr:3
replace_hr:false
replace_br_with_p:false

slow_down_sleep_time:0.5

## http://docs.python.org/library/datetime.html#strftime-strptime-behavior
datePublished_format:%%B %%d, %%Y
dateUpdated_format:%%B %%d, %%Y

add_to_extra_valid_entries:,additional_characters,category_main,dateRange,icon_bookmarked,icon_subscribed,icons,prefix_category,prefix_rating,prefix_ships,prefix_status,prefix_wordcount

additional_characters_label:Characters
category_label:Fandom
dateRange_label:Date

include_in_additional_characters:characters
include_in_category_main:category
include_in_dateRange:datePublished,dateUpdated
include_in_icons:icon_bookmarked,icon_subscribed
include_in_prefix_category:category
include_in_prefix_rating:rating
include_in_prefix_ships:ships
include_in_prefix_status:status
include_in_prefix_wordcount:numWords

keep_in_order_category:true
keep_in_order_characters:true
keep_in_order_ships:true

## keep in order for extra entries
keep_in_order_additional_characters:true
keep_in_order_category_main:true
keep_in_order_dateRange:true
keep_in_order_icons:true
keep_in_order_prefix_category:true
keep_in_order_prefix_ships:true

exclude_metadata_pre:
 category=~(.*) - Fandom
 additional_characters==Other(s)
 additional_characters=~(Original|Various) Character\(?s?\)?
 freeformtags,genre==Other Additional Tags to Be Added
 warnings==Creator Chose Not To Use Archive Warnings
 warnings==No Archive Warnings Apply
## Remove ships that don't have a / or &
 ships,prefix_ships!~(.*)(\/| & )(.*)
## Removes platonic ships in ship lists
 ships,prefix_ships=~(.*) & (.*)
## Removes ships that are only implied or mentioned according to author
 prefix_ships=~^(.*)\(?(implied|mentioned)\)?

replace_metadata:
 rating=> Audiences=>
 rating=>Teen [Aa]nd Up=>Teen
## Change / to & if friendship is mentioned
 ships=>(.*)[/](.*) \(?[Ff]riendship(?: only)\)?=>\1 & \2
 category,prefix_category=>No Fandom=>Original Work
 category,prefix_category=> \(?(- All Media Types|- Fandom|Movies|Movie [0-9]+|Comics|TV|Video Games?)\)?$=>
 additional_characters=> - Character=>
 additional_characters=> ?\((cameo|briefly|if you squint|sort of)\)=>
 additional_characters=> \([Cc]haracter\)=>
 additional_characters=>\(mentions of\) =>
 category,ships= - Fandom$=>
 ships=> - Relationship=>
 ships=>^(.* - Relationship)$=>
 ships=>^(Eventual (.*)/(.*))$=>
## Get first item in list for prefixed tag
 prefix_category_LIST=>^(.*?)(\,.*)=>\1
 category_main_LIST=>^(.*?)(\,.*)=>\1
 prefix_ships_LIST=>^(.*?)(\,.*)=>\1
## Add prefix to tags
 prefix_ships=>^(.*)=>[p] \1
 prefix_category=>^(.*)=>[c] \1
 prefix_rating=>^(.*)=>[r] \1
 prefix_status=>^(.*)=>[s] \1
## Group word count
 prefix_wordcount=>^(\d+|([0-4],\d{3})*|5,000)$=>[w] 0 - 5000
 prefix_wordcount=>^((?!5,000)([5-9],\d{3})*|10,000)$=>[w] 5001 - 10000
 prefix_wordcount=>^((?!10,000)(1\d,\d{3})*|20,000)$=>[w] 10001 - 20000
 prefix_wordcount=>^((?!20,000)([2-3]\d,\d{3})*|40,000)$=>[w] 20001 - 40000
 prefix_wordcount=>^((?!40,000)([4-7]\d,\d{3})*|80,000)$=>[w] 40001 - 80000
 prefix_wordcount=>^((?!80,000)(([8-9]\d)|(\d{3,}))(,\d{3})+)$=>[w] 80000
### Get date range with published date and updated date
## diff dates     1pmonth    2pday        3pyear   4umonth    5uday        6uyear
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})\,\s+(\d{4})\,\s([^\s]+)\s+(\d{1,2})\,\s+(\d{4})=>\1 \2, \3-\4 \5, \6
## same year      1          2            3        4          5
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})\,\s+(\d{4})-([^\s]+)\s+(\d{1,2})\,\s+\3=>\1 \2-\4 \5, \3
## same month     1          2              3            4
 dateRange_LIST=>([^\s]+)\s+(\d{1,2})-\1\s+(\d{1,2})\,\s+(\d{4})=>\1 \2-\3, \4
## don't need regexp for date day, handled by de-dup.
### Bookmark and subscribed icons
 icon_bookmarked=>True=>Bookmarked
 icon_subscribed=>True=>Subscribed
 icon_bookmarked=>False=>Not Bookmarked
 icon_subscribed=>False=>Not Subscribed
## Show bookmarked icon, show subscribed icon
 icons_LIST=>^(Bookmarked\, Subscribed)$=>����
## Don't show bookmarked icon, don't show subscribed icon
 icons_LIST=>^(Not Bookmarked\, Not Subscribed)$=>◈
## Don't show bookmarked icon, show subscribed icon
 icons_LIST=>^(Not Bookmarked\, Subscribed)$=>��
## Show bookmarked icon, don't show subscribed icon
 icons_LIST=>^(Bookmarked\, Not Subscribed)$=>��
## CHANGE BACKGROUND COLOR ACCORDING TO RATING
 output_css=>fff_titlepage_color_replace=>264701&&rating==General
 output_css=>fff_titlepage_color_replace=>38419D&&rating==Teen
 output_css=>fff_titlepage_color_replace=>66347F&&rating==Mature
 output_css=>fff_titlepage_color_replace=>8F0101&&rating==Explicit
 output_css=>fff_titlepage_color_replace=>1B1B1B&&rating==Not Rated 
 output_css=>fff_titlepage_color_replace=>555555
## FILTER REDUNDANT FREEFORM TAGS
 freeformtags=>^(Angst and )(.*)=>Angst\,\2
 freeformtags=>^(Fluff and )(.*)=>Fluff\,\2
 freeformtags=>^(Smut and )(.*)=>Smut\,\2
 freeformtags=>(\w+ )(Fluff)$=>Fluff
 freeformtags=>(\w+ )(Smut)$=>Smut
 freeformtags=>(\w+ )(Angst)$=>Angst
 freeformtags=>(.*)(Hurt\/Comfort)$=>Hurt/Comfort
 freeformtags=>^(Alternate Universe)$=>
 freeformtags=>^(Alternate Universe -)=>AU -
 freeformtags=>^(Drama & Romance)$=>Drama\,Romance
 freeformtags=>^(Friendship)$=>
 freeformtags=>^(Friendship/Love)$=>
 freeformtags=>^(Male-Female Friendship)$=>
 freeformtags=>^(Platonic Female/Male Relationships)$=>
 freeformtags=>^(Platonic Relationships)$=>
 freeformtags=>^(Canon Divergent)$=>Canon Divergence


add_to_custom_columns_settings:
 additional_characters=>#additional_characters
 bookmarked=>#work_bookmarked
 subscribed=>#work_subscribed
 chapterslashtotal=>#chapters
 dateRange=>#date_range
 freeformtags=>#additional_tags

add_to_output_css:
 body {
  text-align: left;
  font-family: 'Noto Sans', sans-serif;
 }
 body.fff_titlepage {
  font-size: 2.5vmax;
  font-family: 'Roboto', sans-serif;
  background-color: #fff_titlepage_color_replace;
  color: white;
 }
 hr {
  display: block;
  border: 0; border-top: 1px solid;
  padding: 0;
 }
## https://stackoverflow.com/a/50191135
 .flex-parent {
  display: flex;
  align-items: center;
 }
 .flex-child-edge {
  flex-grow: 2;
  border-bottom: 1px solid;
 }
 .flex-child-text {
  flex-basis: auto;
  flex-grow: 0;
  text-align: center;
  margin: 0 5px 0 5px;
  font-family: 'Roboto', sans-serif;
 }
 .flex-child-text.stats span { font-weight: bold; }
 .flex-child-text.category { font-weight: bold; }
 .fff_titlepage .title h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 3vmax;
  margin: 0;
 }
 .fff_titlepage .title h1 { font-weight: normal; }
 .fff_titlepage .title h1 a { font-weight: bold; } 
 .fff_titlepage .title a,
 .fff_titlepage .tags a,
 .fff_titlepage .tag-summary-content a {
   text-decoration: none;
   color: unset;
 }
 .fff_titlepage .tag-summary-content a {
  font-style: italic;
 }
 .fff_titlepage .tag-summary-content p {
  margin-top: 0;
 }
 .fff_titlepage .tags {
  display: block;
  padding: 0;
 }
 dl .inline dt:after { content:'\00a0'; }
 dl .inline dt { float: left; }
 .display-on-reader { display: none; }
 .fff_titlepage dt { font-family: 'Roboto Condensed'; }
 .fff_titlepage dd { margin-left: 0.75em; }
 .fff_titlepage dl, .fff_titlepage dt { margin: 0; }
## Change displayed content on titlepage depending on screen width
 @media only screen and (max-device-width: 480px),
 only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  body.fff_titlepage, .fff_titlepage dt {
   background_color: unset;
   color: unset;
   font-family: unset;
  }
  .display-on-cover { display: none; }
  .display-on-reader { display: block; }
  .flex-parent.display-on-reader { display: flex; }
 }

## first ship, first category, rating, status, word count - all prefixed in Calibre's tags
include_subject_tags:prefix_ships_LIST,prefix_category_LIST,prefix_rating,prefix_status,prefix_wordcount

titlepage_start:<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${title} by ${author}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <meta name="calibre-html-render-data"/>
 </head>
 <body class="fff_titlepage">
 <div class="title">
 <h1><a href="${storyUrl}">${title}</a> by ${authorHTML}</h1>
 </div>
  <div class="flex-parent display-on-reader">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text">◈</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="flex-parent display-on-cover">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text category">${category_main}</div>
   <div class="flex-child-edge"></div>
 </div>
 <dl class="tags">



## ${id}, ${label}, ${value}
titlepage_entry:
 <dt><b>${label}:</b></dt> <dd>${value}</dd>

## ${id}, ${label}, ${value}
## Used with entries listed in wide_titlepage_entries, typically description, storyUrl, authorUrl
titlepage_wide_entry:

## When using tables, make these span both columns.
wide_titlepage_entries:

## ${id}, ${value}
## For example, if you've set description_label:
## (that is, nothing)
titlepage_no_title_entry:${value}<br />

## metadata
titlepage_end:
 </dl>
 <div class="flex-parent display-on-cover">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text stats"><span>${rating}</span> ${icons} ${numWords} ◈ ${chapterslashtotal}</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="flex-parent display-on-reader">
   <div class="flex-child-edge"></div>
   <div class="flex-child-text">${icons}</div>
   <div class="flex-child-edge"></div>
 </div>
 <div class="tag-summary-content">${description}</div>
 </body>
 </html>

 
[epub]
make_firstimage_cover:false
jpg_quality:100
convert_images_to:png
remove_transparency:false
no_image_processing:true

[archiveofourown.org]
is_adult:true
always_login:true

username:XXXXXXXX
password:XXXXXXXX

add_chapter_numbers:toconly
mark_new_chapters:latestonly
chapter_title_def_pattern:${title}
chapter_title_add_pattern:${title} (${date})
chapter_title_new_pattern:${title} (${date}) | NEW
chapter_title_addnew_pattern:${title} (${date}) | NEW

include_in_genre:
include_in_icon_bookmarked:bookmarked
include_in_icon_subscribed:subscribed

keep_in_order_ao3categories:true
keep_in_order_freeformtags:true

chapterslashtotal_label:Chapters
freeformtags_label:Tags
freefromtags_label:Tags
ao3categories_label:Category

extratags:

add_to_replace_metadata:
 authorUrl=>(/users/orphan_account)/pseuds/.*$=>\1

titlepage_entries:<div class="inline">,<div class="display-on-reader">,category,</div>,seriesHTML,warnings,ships,additional_characters,freeformtags,dateRange,<div class="display-on-reader">,rating,chapterslashtotal,numWords,</div>,</div>

## ${number}, ${index04}("%04d"%${number}), ${chapter}
chapter_start:<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 <title>${chapter}</title>
 <link href="stylesheet.css" type="text/css" charset="UTF-8" rel="stylesheet"/>
 <meta name="chapterurl" content="${url}"></meta>
 <meta name="chapterorigtitle" content="${origchapter}"></meta>
 <meta name="chaptertoctitle" content="${tocchapter}"></meta>
 <meta name="chaptertitle" content="${chapter}"></meta>
 </head>
 <body class="fff_chapter">
 <h3 class="fff_chapter_title">${origchapter}<hr><small>${date}</small></h3>


Preview:
Spoiler:
Hey, I am new to calibre and mobile read so if im doing a post wrong let me know, but i have been working on my library for a month and came across a lot of your helpful ini tricks so im in the process of adapting them. I love how you have the first ship category and was wondering if there was a way to set a priority of thr first ship. For example I have quite a lot of Hermione Granger/Draco Malfoy/Theodore Nott fanfics, but sometimes the author lists the individual pairs as well, like Draco Malfoy/Theodore Nott and that might come up first. Is there a way to to set something up so that I check for certain pairings in a priority order?

Thanks!
elzzzz is offline   Reply With Quote
Old 09-14-2025, 06:03 AM   #130
culytera
Zealot
culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.
 
Posts: 133
Karma: 295674
Join Date: Jul 2021
Device: iPhone
Quote:
Originally Posted by elzzzz View Post
Hey, I am new to calibre and mobile read so if im doing a post wrong let me know, but i have been working on my library for a month and came across a lot of your helpful ini tricks so im in the process of adapting them. I love how you have the first ship category and was wondering if there was a way to set a priority of thr first ship. For example I have quite a lot of Hermione Granger/Draco Malfoy/Theodore Nott fanfics, but sometimes the author lists the individual pairs as well, like Draco Malfoy/Theodore Nott and that might come up first. Is there a way to to set something up so that I check for certain pairings in a priority order?

Thanks!
Under replace_metadata, add this:
Code:
 ships_LIST,prefix_ships_LIST=>^(.*), (.*(Hermione Granger\/Draco Malfoy\/Theodore Nott))=>\2, \1
Result
culytera is offline   Reply With Quote
Old 09-15-2025, 11:26 PM   #131
hepalien
Junior Member
hepalien began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2025
Device: Multiple Kindles, Booxs, and a Kobo Clara BW
help with include_metadata_post

Thank you all for sharing your metadata tips! They've been a huge help while I've cleaned up my metadata. I've run into an issue that I haven't been able to solve, and I'm hoping someone can help. I'm using include_metadata_post to limit the freeform tags, and it's eliminating some tags that it's supposed to but allowing others through, and I don't understand why. Here is the relevant bit of my personal.ini:

Spoiler:
Code:
include_metadata_post:
 edited_ao3tags==Canon Era
 edited_ao3tags==Case Fic
 edited_ao3tags==Pining
 edited_ao3tags==Christmas
 edited_ao3tags==Fake Rel
 edited_ao3tags==Fix-It
 edited_ao3tags==Fuck or Die
 edited_ao3tags==Idiots to Lovers
 edited_ao3tags==MWPP
 edited_ao3tags==Magic Reveal
 edited_ao3tags==CATWS
 edited_ao3tags==Sexting
 edited_ao3tags==D/S
 edited_ao3tags==H/C
 edited_ao3tags==Friends to Lovers
 edited_ao3tags==Fuck or Die
 edited_ao3tags==PWP
 edited_ao3tags==Porn
 edited_ao3tags==Post-MWPP
 edited_ao3tags==POV Outsider
 edited_ao3tags==Raising Harry
 edited_ao3tags==Rimming
 edited_ao3tags==Exhibitionism
 edited_ao3tags==Sex Clubs
 edited_ao3tags==Sex Pollen
 edited_ao3tags==AU-Sex Worker
 edited_ao3tags==Shrunkyclunks
 edited_ao3tags==Social Media
 edited_ao3tags==Threesome
 edited_ao3tags==Time Travel
 edited_ao3tags==Nipple Play
 edited_ao3tags==Touch-starved
 edited_ao3tags==Party Games
 edited_ao3tags==Love Spell
 edited_ao3tags==Truth Spell
 edited_ao3tags==Watford
 edited_ao3tags=~^BAMF(.*)
 edited_ao3tags=~^AU(.*)


And here are some of the tags that are still showing up in edited_ao3tags:
Click image for larger version

Name:	Screenshot 2025-09-15 at 11.24.10 PM.png
Views:	28
Size:	61.9 KB
ID:	218117
hepalien is offline   Reply With Quote
Old 09-16-2025, 02:33 AM   #132
elzzzz
Junior Member
elzzzz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Sep 2025
Device: iPad/Kindle
Quote:
Originally Posted by culytera View Post
Under replace_metadata, add this:
Code:
 ships_LIST,prefix_ships_LIST=>^(.*), (.*(Hermione Granger\/Draco Malfoy\/Theodore Nott))=>\2, \1
Result
Hey, thanks so much! this works great, however if I want to prioritize other ships as well i seem to run into issues. Dose the code run sequentially and then like repeat its single line until the end then move to the next line? I was trying to understand how the line above works. Because to me it seems like it appears to look at the first ship in the list and then all the other ships together, and then if it has the searched for ship, it will move the first ship to the end and then and then run it again until the specified ship is the first? but then if I wanted to check for a different pair, it would run through them all again, possibly messing up the previous priority.

So I don't know if its possible, but I was hoping to kind of prioritize multiple ships to pick through. I may be reaching with what I'm trying to do but I feel like even if i cant do it all I could do some of it. But I'm at least hoping to better understand how the coding works.

So potentially like this: From Highest Priority to lowest
Multi ship with Draco and Hermione 1st
1/2/3/x/x sometimes there is more than 3 and basically Id want to prioritize the long ship if that has Draco Malfoy and Hermione Granger
- If I could do something like this I wouldnt have to prioritize the specific ships of:
Draco Malfoy/Hermione Granger/Theodore Nott
Draco Malfoy/Harry Potter/Hermione Granger
Blaise Zabini/Draco Malfoy/Hermione Granger
Then if not a multi ship, check to prioritize the different ship. With the current solution, it seems like i might pick Draco Malfoy/Hermione Granger/Theodore Nott, but then when i check for Draco Malfoy/Hermione Granger that would overwrite it, i trie
Draco Malfoy/Hermione Granger
Harry Potter/Hermione Granger
Hermione Granger/Sirius Black
etc

Then maybe last if theres none of those ships, pick which everyone has Hermione Granger in it if possible.

I thought I could possibly do something where instead of doing the list, i actually just delete the other ships, but that wouldn't be ideal, and Id probably have to write out a lot of specifics (which i might have to do anyways, but still just trying to think of the best way)

I have a feeling ill have to change the regex to better get this done and I've started trying to learn, but it doesn't seem to always do what I'm expecting, especially if i do multiple expressions, so I am hoping to get clarity to better understand my limitations.

P.S. I spent the last few weeks religiously reading your posts and using the inis youve posted and they have been such a great help.
elzzzz is offline   Reply With Quote
Old 09-17-2025, 03:27 PM   #133
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,191
Karma: 77899461
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
If you use Action Chains plugin and use a lot of StoryURL sections, I posted a chain in Action Chains Resources that may be useful:

Quote:
Originally Posted by ownedbycats View Post
Here's my enhanced version of the chain that additionally also copies story-specific settings from a column. This allows me to reduce the size of personal.ini by removing settings for completed stories while still keeping them available if I later need them.

to use, create a long-text column (interpret type: plain text) with lookup name #fanficsettings.

As I suggest editing settings in the personal.ini editor rather than the column itself, I also included Calibre ID in the commented header to make it easier to locate the book the section's associated with. An example from my library:

Code:
## stillwaters01 - There Were Days (8382)
[https://archiveofourown.org/works/959950]
exclude_notes:chaptersummary
ownedbycats is offline   Reply With Quote
Old 09-18-2025, 06:32 PM   #134
hepalien
Junior Member
hepalien began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Mar 2025
Device: Multiple Kindles, Booxs, and a Kobo Clara BW
Does anyone know if there's a way to return only the highest rating for an anthology? i.e. if one story is rated Mature and one is rated Teen, then it would return Mature as the content rating?
hepalien is offline   Reply With Quote
Old 09-18-2025, 10:16 PM   #135
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,191
Karma: 77899461
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by hepalien View Post
Does anyone know if there's a way to return only the highest rating for an anthology? i.e. if one story is rated Mature and one is rated Teen, then it would return Mature as the content rating?
https://www.mobileread.com/forums/sh....php?p=4345450

Quote:
Originally Posted by ownedbycats View Post
Another Action Chains post-processing to fix a FanFicFare limitation:

If you use a Ratings column, there's a issue where FanFicFare will concatenate all the ratings on an anthology, producing something like Mature, General Audiences, Mature, Not Rated. Here's my method for fixing this.

1. Edit defaults.ini to standardize your ratings.

Code:
[defaults]

replace_metadata: 
## Ratings
 rating=>^(K|K\+)$=>General Audiences
 rating=>^Teen And Up Audiences$=>Teen and Up Audiences
 rating=>^T$=>Teen and Up Audiences
 rating=>^Mature$=>Mature Audiences
 rating=>^M$=>Mature Audiences
2. In Calibre, go to Preferences > Advanced > Template Functions > Stored Templates tab. Type first_in_list to the template name and paste in this code:

Code:
python:
def evaluate(book, context):
	args = context.arguments
	if args is None or len(args) != 3:
		raise ValueError('first_in_list requires 3 arguments')
	sep = args[1]
	lst = tuple(l.strip() for l in args[0].split(',') if l.strip())
	test_lst = tuple(l.strip() for l in args[2].split(',') if l.strip())
	if not test_lst:
		return ''
	for v in test_lst:
		if v in lst:
			return v
	return ''
Then press the 'Create' button and apply results.

3. Create an Action Chain with a Single-Field Edit affecting your ratings column. Use this template:

Code:
program: 
	first_in_list($#fanficrating, ',', 'Explicit, Mature Audiences, Teen and Up Audiences, General Audiences, Not Rated')
This template will take the aforementioned Mature, General Audiences, Mature, Not Rated and then extract 'Mature' because it's firstmost available item in the provided list. If you'd rather have it in a different order, just change the order of the items in the template.

Thanks to chaley for the python code.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Library management issues after editing metadata dra Library Management 26 04-11-2020 05:10 PM
Best strategy for metadata management for Kobo using Calibre? ceridwen Kobo Developer's Corner 16 05-13-2019 02:51 AM
Will automatic metadata management also transfer updated cover images to device? TheSacredSoul Library Management 2 01-11-2013 06:05 AM
Metadata Management on Android not working? TheStretchedElf Devices 0 08-08-2012 09:10 AM
Automatic Metadata Management gxxshock Calibre 2 12-28-2008 12:48 PM


All times are GMT -4. The time now is 01:39 PM.


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