Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2021, 06:30 PM   #1
SoccerDad91016
Enthusiast
SoccerDad91016 began at the beginning.
 
SoccerDad91016's Avatar
 
Posts: 34
Karma: 10
Join Date: Aug 2014
Device: Kindle Paperwhite, Kindle Fire HD 8, Microsoft Surface Go 3
Lightbulb Update Custom Field when adding new item to a series

A bit of a unique use case (I think). I am using Calibre to manage my library of digital comics. I am then using Calibre Companion to send specific comics to my tablet to read.

What I would like to do is when I add a new item/issue to a series, update a custom date field I've added (#latest_item) with the current date for all items in the series.

As an example, say I have a series with 10 issues going back 2 years. When I add issue 11, I would like to trigger an event that will update the #latest_item date field for all previous 10 issues with the date issue 11 is added.

The end goal is to create reading lists of series that have recently had new issues added and send the entire series (old and new issues) to my tablet via Calibre Companion.

I've looked at the Action Chain plugin, and while promising I'm not sure this gets me exactly what I want. Or at least I haven't figured out how to use it to do what I want

Not sure if there is an existing plugin or feature in Calibre that I can leverage. Or would this require me to create a new plug in?

Ideas and suggestions greatly appreciated.
SoccerDad91016 is offline   Reply With Quote
Old 03-08-2021, 07:41 PM   #2
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
This can be done with action chains plugin, but it requires you to add this custom action to the plugin first (copy/paste into the module editor).

After that import the chain from the zip file attached here (action chains > customize plugin > right click > import). After importing you should find a menu entry called "Add to series and update #latest_item". Run the chain from the menu entry after selecting the book you want to add to the series. A series dialog will pop up asking you for the series name and index, after adding them, the chain will update the #lastest_item column for all books in the series.

The chain has actions that use calibre template language, and it also sets conditions on some actions, so it might not be easy to understand if you have no experience in template language and action chains plugin.

Edit: Always use first on a test library. Never use it without backup until you are completely satisfied it works as expected.
Attached Files
File Type: zip add_to_series.zip (800 Bytes, 135 views)

Last edited by capink; 03-08-2021 at 08:13 PM.
capink is offline   Reply With Quote
Advert
Old 03-08-2021, 08:57 PM   #3
SoccerDad91016
Enthusiast
SoccerDad91016 began at the beginning.
 
SoccerDad91016's Avatar
 
Posts: 34
Karma: 10
Join Date: Aug 2014
Device: Kindle Paperwhite, Kindle Fire HD 8, Microsoft Surface Go 3
Quote:
Originally Posted by capink View Post
This can be done with action chains plugin, but it requires you to add this custom action to the plugin first (copy/paste into the module editor).

After that import the chain from the zip file attached here (action chains > customize plugin > right click > import). After importing you should find a menu entry called "Add to series and update #latest_item". Run the chain from the menu entry after selecting the book you want to add to the series. A series dialog will pop up asking you for the series name and index, after adding them, the chain will update the #lastest_item column for all books in the series.

The chain has actions that use calibre template language, and it also sets conditions on some actions, so it might not be easy to understand if you have no experience in template language and action chains plugin.

Edit: Always use first on a test library. Never use it without backup until you are completely satisfied it works as expected.
That worked great. Had to correct the field name from "lastest" to "latest" but then tested on a few series and the field is being set to the current date as expected.

Is it possible to trigger an action chain from a Calibre event such as saving to disk or updating metadata?
SoccerDad91016 is offline   Reply With Quote
Old 03-08-2021, 09:09 PM   #4
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Make a chain that has either save to disk or update metadata as the first action (Using calibre actions), and then add other actions as you want. Use that chain whenever you want to save to disk/update metadata.
capink is offline   Reply With Quote
Old 03-08-2021, 09:50 PM   #5
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,974
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Note that you can also assign chains to keyboard shortcuts. So you can remove the usual save-to-disk shortcut and then set your chain to it instead.
ownedbycats is offline   Reply With Quote
Advert
Old 03-09-2021, 05:41 PM   #6
SoccerDad91016
Enthusiast
SoccerDad91016 began at the beginning.
 
SoccerDad91016's Avatar
 
Posts: 34
Karma: 10
Join Date: Aug 2014
Device: Kindle Paperwhite, Kindle Fire HD 8, Microsoft Surface Go 3
Thanks all for the help, I've now got it setup to trigger on a keyboard shortcut, and now instead of pulling the current date, it uses the date from the last issue added in case I don't run the script right away.
SoccerDad91016 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom field based on multiple value field for export nindotza Calibre 0 01-02-2021 08:37 AM
CC - custom field not displaying SgtDave Calibre Companion 6 01-04-2019 09:43 AM
Custom series field bug (?) Nitro Calibre Companion 2 01-12-2016 09:40 AM
How to create custom context menu item? gizban Calibre 2 08-22-2010 06:22 PM
Adding a <reference> item to <guide> in OPF file GRiker Sigil 2 04-12-2010 01:06 PM


All times are GMT -4. The time now is 02:33 AM.


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