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:	107
Size:	24.6 KB
ID:	211078   Click image for larger version

Name:	Screenshot 2024-09-28 131110.png
Views:	100
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: 131
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,155
Karma: 77304081
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,155
Karma: 77304081
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,155
Karma: 77304081
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 Yesterday, 10:48 PM   #129
elzzzz
Junior Member
elzzzz began at the beginning.
 
Posts: 1
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
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 08:49 AM.


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