Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-05-2022, 08:22 AM   #1
Fynjisx
Member
Fynjisx began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jul 2022
Location: Россия
Device: xiaomi
good think

why not implement such a thing: every time I open a book, the counter accumulates and calculates the frequency of using the book for a certain period of time
Fynjisx is offline   Reply With Quote
Old 08-05-2022, 09:24 AM   #2
ownedbycats
Wizard
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: 4,361
Karma: 18727666
Join Date: Oct 2018
Location: Canada
Device: Kobo Aura HD (retired), Kobo Libra H2O
Quote:
Originally Posted by Fynjisx View Post
why not implement such a thing: every time I open a book, the counter accumulates and calculates the frequency of using the book for a certain period of time
I do a similar thing. I swapped out the default 'view' keyboard shortcut for a custom Action Chains called 'Read':

Click image for larger version

Name:	2022-08-05 10_21_57-Add actions.png
Views:	54
Size:	24.0 KB
ID:	195633

It shouldn't be too difficult to have it increment a 'times read' integer column.
ownedbycats is offline   Reply With Quote
Old 08-05-2022, 11:00 AM   #3
Fynjisx
Member
Fynjisx began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jul 2022
Location: Россия
Device: xiaomi
Quote:
Originally Posted by ownedbycats View Post
I do a similar thing. I swapped out the default 'view' keyboard shortcut for a custom Action Chains called 'Read':

Attachment 195633

It shouldn't be too difficult to have it increment a 'times read' integer column.
can you explain step by step how to do it?
Fynjisx is offline   Reply With Quote
Old 08-05-2022, 06:20 PM   #4
ownedbycats
Wizard
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: 4,361
Karma: 18727666
Join Date: Oct 2018
Location: Canada
Device: Kobo Aura HD (retired), Kobo Libra H2O
1. Go to Preferences > Add your own columns.

2. Create a new Integer column with the lookup name 'timesread'.

3. (Optional) Create a new date column with the lookup name 'lastread.'*

4. Go to Preferences > Plugins > Get New Plugins and install Action Chains.
Make sure to add it to the toolbar or context menu. Restart Calibre.

5. Download the attached file and put it somewhere.

6. Go to Action Chains > Add/Modify Chains.

7. Right-click the main part of the window and use 'Import' to add the downloaded zip file.

8. Test that it works. If it does, it'll open the book, increment #timesread by 1, and set #lastread to the current time.

8. Assign it to a keyboard shortcut. Note that this will not work if you open it in other methods (e.g. the 'view' toolbar button).

* If you don't want this, make sure to remove the 'Set #lastread to current date' from the chain before running it.

Note that I also set it to activate when one book is selected. This prevents accidentally opening the entire library if you hit the keyboard shortcut by mistake.
Attached Files
File Type: zip Read Book.zip (3.6 KB, 294 views)
ownedbycats is offline   Reply With Quote
Old 08-06-2022, 12:00 AM   #5
Wiggo
Connoisseur
Wiggo began at the beginning.
 
Wiggo's Avatar
 
Posts: 59
Karma: 10
Join Date: Feb 2019
Device: iPad Pro, Kobo Libra 2
May I ask what the refresh view is for?
Wiggo is offline   Reply With Quote
Old 08-06-2022, 02:01 AM   #6
Fynjisx
Member
Fynjisx began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jul 2022
Location: Россия
Device: xiaomi
Quote:
Originally Posted by ownedbycats View Post
1. Go to Preferences >
5. Download the attached file and put it somewhere.
what is this file? can you make it yourself or is it some kind of standard?
Fynjisx is offline   Reply With Quote
Old 08-06-2022, 10:20 AM   #7
ownedbycats
Wizard
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: 4,361
Karma: 18727666
Join Date: Oct 2018
Location: Canada
Device: Kobo Aura HD (retired), Kobo Libra H2O
Quote:
Originally Posted by Wiggo View Post
May I ask what the refresh view is for?
A custom module. I use it to re-sort books at the end of a chain.

Code:
from calibre_plugins.action_chains.actions.base import ChainAction

class RefreshAction(ChainAction):

    name = 'Refresh View'

    def run(self, gui, settings, chain_loop):
        gui.current_view().resort()
Quote:
Originally Posted by Fynjisx View Post
what is this file? can you make it yourself or is it some kind of standard?
It's an Action Chain. I built the chain in the plugin and then exported it:

Click image for larger version

Name:	2022-08-06 11_18_18-Chains Dialog.png
Views:	277
Size:	62.8 KB
ID:	195656
ownedbycats is offline   Reply With Quote
Old 08-06-2022, 10:32 AM   #8
Fynjisx
Member
Fynjisx began at the beginning.
 
Posts: 20
Karma: 10
Join Date: Jul 2022
Location: Россия
Device: xiaomi
Quote:
Originally Posted by ownedbycats View Post
A custom module. I use it to re-sort books at the end of a chain.

Code:
from calibre_plugins.action_chains.actions.base import ChainAction

class RefreshAction(ChainAction):

    name = 'Refresh View'

    def run(self, gui, settings, chain_loop):
        gui.current_view().resort()
where is this code written? Is there a manual for writing code?
Fynjisx is offline   Reply With Quote
Old 08-06-2022, 12:01 PM   #9
Wiggo
Connoisseur
Wiggo began at the beginning.
 
Wiggo's Avatar
 
Posts: 59
Karma: 10
Join Date: Feb 2019
Device: iPad Pro, Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
A custom module. I use it to re-sort books at the end of a chain.

Code:
from calibre_plugins.action_chains.actions.base import ChainAction

class RefreshAction(ChainAction):

    name = 'Refresh View'

    def run(self, gui, settings, chain_loop):
        gui.current_view().resort()
I can read it, but I don't understand it.
What kind of re-sort is this code doing?
Wiggo is offline   Reply With Quote
Old 08-06-2022, 01:11 PM   #10
ownedbycats
Wizard
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: 4,361
Karma: 18727666
Join Date: Oct 2018
Location: Canada
Device: Kobo Aura HD (retired), Kobo Libra H2O
Quote:
Originally Posted by Fynjisx View Post
where is this code written? Is there a manual for writing code?
On the screenshot in post #7, you can see 'Modules' in the lower right corner. You can add it there.

Quote:
Originally Posted by Wiggo View Post
I can read it, but I don't understand it.
What kind of re-sort is this code doing?
If I recall right, it'll behave as if you did a bulk metadata edit with 'refresh book list' active.
ownedbycats is offline   Reply With Quote
Old 08-07-2022, 12:33 AM   #11
Wiggo
Connoisseur
Wiggo began at the beginning.
 
Wiggo's Avatar
 
Posts: 59
Karma: 10
Join Date: Feb 2019
Device: iPad Pro, Kobo Libra 2
Thx, I will have a look.
Wiggo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
good screen, good/custom fonts, just works? grimborg Which one should I buy? 9 01-07-2012 04:36 PM


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


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