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 08-13-2021, 03:50 AM   #1
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
[GUI Plugin] Last Modified

This plugin enables the user to have his own custom last_modified column(s), instead of relying on calibre's last_modified which is reserved for internal use and sometimes changes when the books has not been modified. The plugin can update one or more custom date column(s) whenever one or more of the following events happen:
  • book metadata updated. (with options on what columns to include/exclude)
  • cover modified.
  • format added.
  • format(s) removed.
  • category item renamed.
  • category item removed.
  • book edited by calibre editor.
  • book created.

This gives the user more flexibility in defining when a custom #last_modified column(s) should be updated. There is also option to include/exclude changes from certain columns from updating the custom Last modified column(s) (see screenshots).


Note that you must add at least one custom date column to be able to use this plugin.

Installation Notes:
Special Notes:
  • Requires Calibre 5.28.0 or later.

Credits
  • Special thanks for Kovid for adding the necessary changes in calibre source to make this plugin possible. Also chaley for his suggestions and feedback.

Paypal Donations:
  • If you find this useful please feel free to show your appreciation.

Version History:
Spoiler:

Version 0.8.5 - 29 September 2023
Update: Automatically exclude last_modfied column.

Version 0.8.3 - 9 August 2022
Update: update to calibre6 icon themes. Code borrowed from @JimmXinu.

Version 0.8.3 - 17 July 2022
Fix PyQt6 migration bug.

Version 0.8.2 - 13 January 2022
Fix PyQt6 migration bug.

Version 0.8.1 - 13 January 2022
Fix: PyQt6 migration bug.

Version 0.8.0 - 6 January 2022
Changes for the upcoming PyQt6.

Version 0.7.1 - 16 September 2021
Fix: Commit events in hibernation cache on and shutting_down. Reset hibernation data on library_change.

Version 0.7.0 - 15 September 2021
Update: Modify Hibernation mode.

Version 0.6.0 - 13 September 2021
Update: Add Hibernation mode.

Version 0.5.0 - 3 September 2021
Minor fixes.

Version 0.4.0 - 27 August 2021
Fix: Bug when multiple database events are happening in succession, leading to apsw.ThreadingViolationError.

Version 0.3.0 - 16 August 2021
Update: Add book created event and drop all other events for created books.

Version 0.2.0 - 13 August 2021
Bug fixes.

Version 0.1.0 - 13 August 2021
Initial Release.

Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	644
Size:	33.3 KB
ID:	188668   Click image for larger version

Name:	2.png
Views:	609
Size:	41.5 KB
ID:	188748   Click image for larger version

Name:	3.png
Views:	548
Size:	41.1 KB
ID:	188749  
Attached Files
File Type: zip Last Modified_0.8.5.zip (87.9 KB, 9871 views)

Last edited by capink; 09-29-2023 at 07:46 AM. Reason: Version 0.8.5
capink is offline   Reply With Quote
Old 08-13-2021, 01:44 PM   #2
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,229
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
First of all: Thank you very much, I'm going to give it a try. I've installed over calibre 5.25 Windows 64 bit and it doesn't start. If I run calibre in debug mode, I find the following log:

Spoiler:
Code:
  File "calibre\gui2\ui.py", line 136, in __init__
  File "calibre\gui2\ui.py", line 154, in init_iaction
  File "calibre\customize\__init__.py", line 626, in load_actual_plugin
  File "importlib\__init__.py", line 127, in import_module
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "calibre\customize\zipplugin.py", line 192, in exec_module
  File "calibre_plugins.last_modified.action", line 26, in <module>
  File "calibre\customize\zipplugin.py", line 192, in exec_module
  File "calibre_plugins.last_modified.config", line 19, in <module>
ModuleNotFoundError: No module named 'calibre_plugins.category_tags'


I don't know which the problem is.
Terisa de morgan is offline   Reply With Quote
Advert
Old 08-13-2021, 02:02 PM   #3
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Sorry for the mishap. I uploaded a new version.
capink is offline   Reply With Quote
Old 08-13-2021, 02:09 PM   #4
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,229
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
No need to be sorry, thank you for your work.
Terisa de morgan is offline   Reply With Quote
Old 08-13-2021, 02:09 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: 8,560
Karma: 61170925
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
This'll be useful!
ownedbycats is offline   Reply With Quote
Advert
Old 08-13-2021, 04:29 PM   #6
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,560
Karma: 61170925
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: Does "book metadata change" check for changes in composite columns?

I have it set to change for all columns except for my reading-status (#read, #percentread, #lastread, and a few others). However, I have a composite #currentlyreading column that pulls from those. Should I add that too, or will LM ignore it?

Last edited by ownedbycats; 08-13-2021 at 04:32 PM.
ownedbycats is offline   Reply With Quote
Old 08-13-2021, 05:03 PM   #7
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
No. It does not respond to changes in composite columns.
capink is offline   Reply With Quote
Old 08-13-2021, 06:15 PM   #8
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,560
Karma: 61170925
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Thank you.
ownedbycats is offline   Reply With Quote
Old 08-17-2021, 06:29 AM   #9
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
I posted a new version. This version adds a new event called "Book Created" for newly added book(s). In the previous version, the following events were triggred when adding books:
  • metadata_changed: This event was triggred multiple times for newly added books (once for each field).
  • cover_modified.
  • format_added.

As a result, there were a lot of events per book, and consequently multiple updates to date fields by the plugin when a book was added. This lead to problem when adding multiple books (ThreadViolationError Exception).

So, the in the new plugin, all the above events are dropped for newly created books; so they will not update any date field. The only event that is not dropped is the "book_created" event.

This makes it cleaner IMO. Also it reduces the frequency of the ThreadViolationError exception, although I am not sure it goes away completely. So people using the plugin can start in debug mode and monitor whether this error is still happening.
capink is offline   Reply With Quote
Old 08-27-2021, 03:46 PM   #10
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Version 0.4.0

Version 0.4.0
  • Fix: Bug when multiple database events are happening in succession, leading to apsw.ThreadingViolationError.
capink is offline   Reply With Quote
Old 08-29-2021, 04:28 PM   #11
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,560
Karma: 61170925
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: Is it possible that the threading violation error could result in database changes no longer saving as described in this thread?

I read the other thread in Development but it was not clear whether it was a silent error (which I would not have noticed as I keep the debug log minimized) or not.

I did do a bulk-edit (if relevant, changing the value of an enumerated column) with the bugged version of Last Modified activated. I checked the books and the #lastmodified datetime was written to OPF and restored with the rest of the database.

Last edited by ownedbycats; 08-29-2021 at 04:54 PM.
ownedbycats is offline   Reply With Quote
Old 08-29-2021, 04:55 PM   #12
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
Quote:
Originally Posted by ownedbycats View Post
Question: Is it possible that the threading violation error could result in database changes no longer saving as described in this thread?


I did do a few bulk-edits with the bugged version of Last Modified activated. I checked the books and the #lastmodified datetime was written to OPF and restored with the rest of the database.
I cannot be 100% sure about this, but I don't think so. While trying to figure out the issue I replicated this error a lot of times, and the behavior you described never happened to me. And almost always it happened to only one book (When adding multiple books).

Also when testing, I restarted calibre multiple times to test various edits to the plugin, and the added books were always there. I deleted them in mass at the very end.

Still cannot be sure. I guess Kovid is better equipped to answer this.

Quote:
Originally Posted by ownedbycats View Post
I read the other thread in Development but it was not clear whether it was a silent error (which I would not have noticed as I keep the debug log minimized) or not.
Yes, the error was silent. You had to watch the debug output to notice it.
capink is offline   Reply With Quote
Old 08-29-2021, 05:01 PM   #13
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,560
Karma: 61170925
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Do you also run from source? I am curious whether there'd be any changes to Calibre that weren't present when you were testing that may affect things. I built from source shortly after 5.26 was released (this change wasn't in stable).

Or there could be other factors as to why it would fall over for me but not you.

Last edited by ownedbycats; 08-29-2021 at 05:08 PM.
ownedbycats is offline   Reply With Quote
Old 08-29-2021, 05:15 PM   #14
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,085
Karma: 1948136
Join Date: Aug 2015
Device: Kindle
No. I don't run from source, and I don't think that particular change you linked to would make a difference. But maybe there are other factors I am not aware of.
capink is offline   Reply With Quote
Old 08-29-2021, 05:21 PM   #15
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,734
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
A threading violation or any other error while writing the database could cause a transaction to be rolled back. How big is a transaction? My guess: changes to a column for all affected books.
chaley is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 AM
[GUI Plugin] Manga plugin mastertea Plugins 6 01-06-2022 02:43 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 11:10 PM.


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