View Single Post
Old 04-19-2017, 11:23 AM   #1
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
[GUI Plugin] Audit Log

[GUI Plugin] Audit Log


Summary:

Undo/Reverse most metadata deletes and updates days or weeks later for selected books and log entries. Creates a log entry for every addition, change or delete for most Calibre standard metadata columns, and for all custom metadata columns.

The 'Audit Log Activity Detail' listing may be viewed, optionally exported to the Clipboard as a tab-delimited file, and then purged (or not). If it is purged, no Undo's may be performed for the deleted items, but rather for only future metadata changes.

Undo's may themselves be Undone, of course.


Logging Metadata Scope:

The Standard Calibre metadata columns that are tracked by Audit Log are:
  • title
  • author_sort [1]
  • pubdate [2]
  • series
  • series index
  • tags
  • publisher
  • identifiers
  • comments [3]
  • languages
  • formats

[1] Author_sort is used as a proxy for authors, as it greatly simplifies the logging for books with multiple co-authors. Example: a book with 100 co-authors would require 100 lines in the log, whereas using author_sort requires only 1 line in the log.

[2] Pubdate is expressed in the original +0000 UTC, not the Local Time of the User initiating a change in pubdate.

[3] Comments can be quite long, so only the first 25 characters are shown in the 'Audit Log Activity Detail'. Internally, AL captures the full length, which is available for viewing via a DB browsing utility if necessary. The table to browse is '_audit_log'.

Optionally, AL also tracks all changes to all Custom Columns.

You can track Custom Columns and not Standard Columns, and vice versa. Plus, both of course.


Undo/Reverse Metadata Scope:

The Standard Calibre metadata columns that may be Undone:
  • title
  • pubdate
  • series
  • publisher
  • identifiers
  • comments
  • languages
All Custom Calibre metadata columns may be Undone.



Types of Activities Triggering Logging:
  • User metadata changes via the Calibre GUI for the current Library, including Standard Calibre functionality as well as Calibre Plug-ins.
  • User copying of books from the current Library to another Library. The activity in the other Library will be logged in that other Library. If the copy is a "copy it and then delete it" type, the deletion of the book from the current Library will be logged in the current Library.
  • Executing Calibre via its command line utilities if it results in a metadata.db database update of any of the metadata currently within the scope of AL.
  • Executing any non-Calibre (external third-party) programs that directly update the metadata.db database for any of the metadata currently within the scope of AL.

Example Uses:
  • Track what metadata within the scope of AL has been changed, when it was changed, and what the old and new metadata values were. Why do this? Because you just want to, or actually need to.
  • If you know who was using your Calibre Library at a specific time, then you have an audit trail of what they did. If so, you can reverse what they did that was logged by AL.
  • Reconstruct the metadata for a book that was erroneously deleted (assuming you have the original ebook format itself to use to add back to Calibre), and for which you had no Calibre backup.
  • Easily confirm the results of a 'Merge Books' add/copy scenario, and change the pre-existing book back to either what it was or what it should be if so desired.
  • Use as a testing tool for Calibre plug-ins that change metadata columns that are within the scope of AL.
  • Discover or keep track of unknown non-Calibre software (e.g., a third-party ebook application) that updates metadata.db via direct database updates.

Requires Minimum Calibre Version: 6.0.0


Version History:
Spoiler:

Version 1.0.19 - 2023-01-07 Qt.core.
Version 1.0.18 - 2022-04-13 Qt6 Compatibility; Minimum Calibre Version now 6.0.0 (5.99.9+)
Version 1.0.16 - 2020-12-19 Miscellany.
Version 1.0.15 - 2020-08-01 Qt tweaks for small displays.
Version 1.0.14 - 2019-12-20 Technical changes after Python 3.8 testing with Calibre 4.99.2
Version 1.0.13 - 2019-12-16 Technical Tweaks after compiling with Python 3.8.150
Version 1.0.12 - 2019-12-15 Python 3.8 Compatibility; Minimum Calibre Version now 4.6.0
Version 1.0.11 - 2019-04-30 Additional Python 3 Compatibility.
Version 1.0.10 - 2019-04-24 Additional Python 3 Compatibility.
Version 1.0.9 - 2019-04-21 Python 3 Compatibility; Minimum Calibre Version now 3.41.3.
Version 1.0.8 - 2017-09-12 New triggers added (silently) for table 'data' for formats.
Version 1.0.7 - 2017-05-22 New trigger added (silently) for comments that are 'updated' by certain plugins. Calibre itself does only an 'insert or replace', not an 'update'.
Version 1.0.6 - 2017-04-29 New menu option: Show Audit Log Status for Calibre Libraries.
Version 1.0.5 - 2017-04-28 Functionality tweaks.
Version 1.0.4 - 2017-04-27 Various functionality enhancements.
Version 1.0.3 - 2017-04-26 New menu option: Undo/Reverse Delete or Update. This is available for all custom columns plus title, pubdate, language, series, comments, identifiers, and publisher. Also, a few triggers have been reworked to improve functionality. To install this Version, AL must be totally deactivated to drop all of AL's SQLite objects in every Library for which it was ever activated, then Calibre restarted, and then AL re-activated.
Version 1.0.2 - 2017-04-20 All triggers have been reworked to improve both performance and functionality. AL must be totally deactivated to drop all of AL's SQLite objects, Calibre restarted, and then AL re-activated.
Version 1.0.1 - 2017-04-19 The scope of metadata now includes all custom columns if desired. Standard Calibre columns and/or custom columns may be activated. However, deactivation deactivates everything.
Version 1.0.0 - 2017-04-18 Initial release.

Attached Thumbnails
Click image for larger version

Name:	undo_example.jpg
Views:	1094
Size:	901.5 KB
ID:	156382   Click image for larger version

Name:	al_customize.jpg
Views:	851
Size:	715.0 KB
ID:	156383   Click image for larger version

Name:	al_example_1.jpg
Views:	839
Size:	1.25 MB
ID:	156384  
Attached Files
File Type: zip audit_log.zip (67.0 KB, 21437 views)

Last edited by DaltonST; 01-08-2023 at 04:55 PM. Reason: Version 1.0.19
DaltonST is offline   Reply With Quote