|
|
#1576 | |
|
Leftutti
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 625
Karma: 3671119
Join Date: Feb 2019
Location: Bavaria
Device: iPad Pro, Kobo Libra 2
|
Quote:
![]() Code:
from calibre_plugins.action_chains.actions.base import ChainAction
from calibre.utils.titlecase import titlecase
class MyAction(ChainAction):
# replace with the name of your action
name = 'Title Case Original Title'
support_scopes = True
def run(self, gui, settings, chain):
api = gui.current_db.new_api
selected_books = chain.scope().get_book_ids()
old_titles = api.all_field_for("#original_title", selected_books, None)
new_titles = {k: titlecase(v) for k, v in old_titles.items()}
updates = {k: v for k, v in new_titles.items() if v != old_titles[k]}
changed_ids = api.set_field(f"#original_title", updates)
# updating marks and view might be useful too?
#marks = {id: "Changed title" for id in changed_ids}
#gui.current_db.set_marked_ids(marks)
#gui.library_view.model().refresh_ids(changed_ids)
Code:
from calibre_plugins.action_chains.actions.base import ChainAction
from calibre.utils.titlecase import titlecase
class MyAction(ChainAction):
name = 'Mark Non-Titlecase Original Titles'
support_scopes = False
def run(self, gui, settings, chain):
api = gui.current_db.new_api
db = gui.current_db
all_books = list(api.all_book_ids())
titles = api.all_field_for("#original_title", all_books, None)
marks = {book_id: "caps_title" for book_id, title in titles.items() if title and title != titlecase(title)}
db.set_marked_ids(marks)
gui.library_view.model().refresh_ids(list(marks.keys()))
|
|
|
|
|
|
|
#1577 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 107
Karma: 1835990
Join Date: Nov 2010
Location: West of the Pecos
Device: FireHD8, iPad
|
Wondering if Actions Chains would do the following:
I routinely eMail ePubs to my Amazon Kindle account from within Calibre. This normally works perfectly as long as I verify that the ePub isn't too large (in MB). Usually I lossy compress the images to 40% or so and this takes care of any MB issue. So I eMail the ePub from within Calibre. I then check the "Jobs" to verify success. Finally, if successful, I have a custom column I've named "Sent" which I click upon and set the value to Yes which yields a green checkmark. A book I haven't yet sent displays a red "X". So can I craft some sort of Action Chain that does this: 1. eMail the book. 2. Verify the Job completed successfully. (If not, show a modal "failure" dialog.) 3. if the Job completed successfully, set the "Sent" column to "Yes". I seem to recall I asked a similar question some years ago and process #2 couldn't be done so process #3, therefore, wasn't done regardless of the success or failure of #2. I hope I've been clear enough. Thanks in advance for any assistance. Barry |
|
|
|
|
|
#1578 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 605
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
Hi,
Can I do "recount pages" using the built-in page count of Calibre? |
|
|
|
|
|
#1579 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 83,762
Karma: 153649587
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
|
|
|
|
#1580 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 605
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
|
|
|
|
|
|
|
#1581 | |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15
Karma: 39964
Join Date: Mar 2010
Device: Boox Leaf
|
Quote:
Code:
db = self.gui.current_db.new_api
db.mark_for_pages_recount()
db.queue_pages_scan(force=force)
self.gui.library_view.model().zero_page_cache.clear()
Last edited by VapidRapidReader; 06-04-2026 at 12:17 PM. |
|
|
|
|
|
|
#1582 |
|
Preferred pronouns: We/Us
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 256
Karma: 533346
Join Date: Jun 2014
Location: <--- Over There, USA
Device: Kindle PW 2
|
I'm sorry to be so stupid, but this stuff is almost beyond me!
I need to copy the info in the series column to the front of the title, plus one space. Finished example title: [The Corps 01] Semper Fi It seems the only way to reliably get a book onto The Spouse's Kindle is via Send to Kindle and this is how he wants it to display. There are a number of books to do, so clicking a button would really be helpful! Will this plug in do that? |
|
|
|
|
|
#1583 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,818
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Set for a Kindle2 Code:
{series || }{title} > {title}
I used collections for the series name (not available after K4) and only added a series index this code formatted the index consistently to ##.## Code:
{series_index:0>5.2f|| - }{title}
|
|
|
|
|
|
|
#1584 |
|
Preferred pronouns: We/Us
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 256
Karma: 533346
Join Date: Jun 2014
Location: <--- Over There, USA
Device: Kindle PW 2
|
Thank you, theducks! You're always ready to jump in with help and I really do appreciate it!
EDIT: Since I never use Save to Disk, I edited the preference in Import/Export to do what I wanted. Last edited by Ma'am-I-Am; 06-06-2026 at 07:37 PM. Reason: Solved, sort of |
|
|
|
|
|
#1585 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,818
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Make a custom calculated column Code:
{series} {title}
|
|
|
|
|
|
|
#1586 | |
|
Preferred pronouns: We/Us
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 256
Karma: 533346
Join Date: Jun 2014
Location: <--- Over There, USA
Device: Kindle PW 2
|
Quote:
The way I do it is to open my main library, copy the books wanted to his db, open his db, click Save to Disk. Open S2K in my browser, click and drag those newly renamed files in that folder. Once they're uploaded, delete the books from his db and the renamed files (to save space). Really, it only takes a few minutes. If you want to discuss this further (not a problem), PM me. Otherwise, we'll go off topic here. I consider my question solved. |
|
|
|
|
|
|
#1587 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,818
Karma: 64144480
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
|
|
|
|
|
#1588 |
|
Preferred pronouns: We/Us
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 256
Karma: 533346
Join Date: Jun 2014
Location: <--- Over There, USA
Device: Kindle PW 2
|
Yes, as I pretty much said in my original post. I assumed anyone reading it would understand Send to Kindle as a service (as opposed to send to device). My bad. What I'm doing now works. On a similar note, I never did figure out how to send by email directly from Calibre. That's a project for another day, though.
Last edited by Ma'am-I-Am; 06-07-2026 at 06:12 PM. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Action Chains Resources | capink | Plugins | 83 | 05-07-2026 02:16 AM |
| [Editor Plugin] Editor Chains | capink | Plugins | 131 | 04-26-2026 05:33 AM |
| [GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
| [GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |