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 09-16-2022, 12:08 PM   #916
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by capink View Post
There was a problem with the module that interfered with calibre's normal metadata download. I posted a new version. Please restart calibre and copy the new code instead.
Thank you, done it.
Terisa de morgan is offline   Reply With Quote
Old 09-23-2022, 06:43 AM   #917
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: 8,631
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: One of my action chains opens the Reading List "edit list" dialog. Normally, it's resizable by dragging the edge of the window. When called by the action chain, it isn't. Any idea what's going on?

It's probably not worth fixing, just curious.
ownedbycats is online now   Reply With Quote
Old 09-23-2022, 07:28 AM   #918
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,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
No idea why something like this would happen. The Calibre Actions just calls the menu's qaction and it has no control over anything else.
capink is offline   Reply With Quote
Old 09-23-2022, 07:30 AM   #919
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: 8,631
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Perhaps some Qt weirdness because of the progress bar? That's my best guess.
ownedbycats is online now   Reply With Quote
Old 09-29-2022, 08:16 PM   #920
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: 8,631
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: Is it possible to set the default of a runtime variable to the value of a specified column of the selected book?

Code:
program:

	currentchap = globals(Current_Chapter=1);
 	strcat('OEBPS/file', format_number(add(currentchap, 1), '04d'), '.xhtml#kobo.1.1')
For example, can I set Current_Chapter to default to the value of #chaptercount rather than 1?

Last edited by ownedbycats; 09-29-2022 at 08:20 PM.
ownedbycats is online now   Reply With Quote
Old 09-29-2022, 08:42 PM   #921
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,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Question: Is it possible to set the default of a runtime variable to the value of a specified column of the selected book?

Code:
program:

	currentchap = globals(Current_Chapter=1);
 	strcat('OEBPS/file', format_number(add(currentchap, 1), '04d'), '.xhtml#kobo.1.1')
For example, can I set Current_Chapter to default to the value of #chaptercount rather than 1?
For runtime variables, the default value is irrelevant whenever you run the chain. It will always be assigned to the value you specified at the pop up variable dialog. Even if you press OK without specifying a value, the value will be an interpreted as an empty string.

The only time the default value has any effect; is at config time to act as place holder for numerical values, to prevent template errors, as explained in the notes section of this post.

Edit: Also the runtime variable cannot be per book, but per chain.

Last edited by capink; 09-29-2022 at 08:59 PM.
capink is offline   Reply With Quote
Old 10-02-2022, 10:58 PM   #922
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
Is it possible to have icons on the menu listing of the chain variations?
tamaracks is offline   Reply With Quote
Old 10-03-2022, 06:19 AM   #923
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,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by tamaracks View Post
Is it possible to have icons on the menu listing of the chain variations?
Yes, as documented here, you can do it by specifying the icon name as the fourth argument.

Code:
program:
    add_chain_variant('second variant','argument2',  'submenu1', 'icon.png')
If you don't want a submenu, put an empty string:
Code:
program:
    add_chain_variant('second variant','argument2',  '', 'icon.png')
capink is offline   Reply With Quote
Old 10-06-2022, 08:43 AM   #924
Hukuro
Junior Member
Hukuro began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2022
Device: none
Can this plugin help me find all the books which are the first occurrences in any series (not necessarily volume 1)? I use Calibre 5.44.

Someone tried to help in another thread, suggested a custom column, but its code makes use of the book_values() function which doesn't work in my version.
Hukuro is offline   Reply With Quote
Old 10-06-2022, 10:27 AM   #925
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Hukuro View Post
Can this plugin help me find all the books which are the first occurrences in any series (not necessarily volume 1)? I use Calibre 5.44.

Someone tried to help in another thread, suggested a custom column, but its code makes use of the book_values() function which doesn't work in my version.
This chain works for me. It sets a custom Yes/No column to Yes for the first book (lowest series_index) in each series, and undefined for all other books. You must change the selection modifier actions to use your column. You probably want to give the chain a keyboard shortcut.

Once you run the chain you can use search to find the books of interest. Or maybe a virtual library that shows only "first books".

I don't know if this is the best way to do it. I thought about using book variables instead of selections but that seemed somewhat more complicated. There are other ways to build the list of ids that might be faster.

EDIT: I tested it with calibre portable 5.44. It worked.
Attached Files
File Type: zip First book in series action chain.zip (810 Bytes, 45 views)

Last edited by chaley; 10-06-2022 at 10:54 AM.
chaley is offline   Reply With Quote
Old 10-06-2022, 12:34 PM   #926
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Here is a version of a "First book in series" chain that uses a template scope instead of selections. It is a bit faster and doesn't flash the selections on the screen. I didn't test it on 5.44.
Attached Files
File Type: zip first book series template scope.zip (736 Bytes, 54 views)
chaley is offline   Reply With Quote
Old 10-06-2022, 12:55 PM   #927
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,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by chaley View Post
This chain works for me. It sets a custom Yes/No column to Yes for the first book (lowest series_index) in each series, and undefined for all other books. You must change the selection modifier actions to use your column. You probably want to give the chain a keyboard shortcut.

Once you run the chain you can use search to find the books of interest. Or maybe a virtual library that shows only "first books".

I don't know if this is the best way to do it. I thought about using book variables instead of selections but that seemed somewhat more complicated. There are other ways to build the list of ids that might be faster.

EDIT: I tested it with calibre portable 5.44. It worked.
It performs reasonably well on my system. Below is a modified version that has a couple of differences:
  • It does not require a custom column, instead it displays the results immediately. From there the user can choose to select all books and bulk edit them if he wishes.
  • This is a technical and a non significant change. It uses category_items('series') to list all the series. Note that the resulting list is separated by ':::', so the for loop is modified accordingly.
Attached Files
File Type: zip display_first_book_in_series.zip (913 Bytes, 53 views)
capink is offline   Reply With Quote
Old 10-06-2022, 01:17 PM   #928
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by capink View Post
It performs reasonably well on my system. Below is a modified version that has a couple of differences:
[*]It does not require a custom column, instead it displays the results immediately. From there the user can choose to select all books and bulk edit them if he wishes.
Hmmm, I think I would want it to do the work directly. However, your version lets the user decide what the "work" is, which can be a good thing. It also works without modifying the chain, which is excellent for non-technical people.
Quote:
[*]This is a technical and a non significant change. It uses category_items('series') to list all the series. Note that the resulting list is separated by ':::', so the for loop is modified accordingly.
category_items() is a much better, clearer way to do it. Thanks!

Attached is a copy of my chain that uses template scopes instead of selections, using category_items() in the scope template.

Now @Hukuro gets to pick which one to use. @Hukuro: it should be @capink's version or the one on this post, suitably modified. The differences:
  • @capinks will work without modifying the chain. You must decide what to do with the list of marked books. It very easily could be that marking the books is sufficient for your needs.
  • Mine won't work out of the box. You must change the Single Field Edits to use your custom Yes/No column. You might need to create that column. It sets the column so you don't have any post processing.
Attached Files
File Type: zip First book in series template scope take 2.zip (742 Bytes, 49 views)
chaley is offline   Reply With Quote
Old 10-06-2022, 01:39 PM   #929
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,090
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Well, the chain variations feature can make a single chain perform either version. But it is in the experimental mode, which needs a tweak to enable. I will make it available to all users in the next version.
capink is offline   Reply With Quote
Old 10-06-2022, 02:51 PM   #930
Hukuro
Junior Member
Hukuro began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2022
Device: none
Thank you both, capink and chaley. I tried both codes and they work as intended. I wouldn't be able to write something like this by myself. Thanks again for the help
Hukuro is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Editor Plugin] Editor Chains capink Plugins 83 Today 07:44 PM
Action Chains Resources capink Plugins 54 01-29-2024 11:24 PM
[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


All times are GMT -4. The time now is 08:36 PM.


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