Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-10-2024, 05:27 PM   #1
meghane_e
Connoisseur
meghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercise
 
Posts: 86
Karma: 38050
Join Date: Sep 2016
Device: Kindle
calibredb to get last_modified data

I'm picking back up a project from a few years ago:
https://www.mobileread.com/forums/sh...d.php?t=338741

I got most of my libraries merged but I never got around to cleaning up the extra backup libraries. I can Import the old backups with no problem. Calibre shows all of the timestamps I would expect to see for the dates of the imported library. But it turns out when I tried creating a custom column, Calibre immediately updates the last_modified column to today's date.

I want to keep a history of what the last_modified column contains prior to making any changes on a newly imported Library so that in the future I can figure out when a book was merged from another library and when.

Otw, I'm using calibredb to get the data and will create a small database to track changes there. Does anyone know if any of the plugins do something like this already? It seems unlikely, but figured I'd ask.

For each library directory (not the backup data directories)
Code:
calibredb list --with-library "C:\Calibre Library\Old Libraries\<library>" --f 
title,author,last_modified,timestamp > ".\<library>_premerge_dates.csv"
Notes: calibre.exe has to be shutdown. calibredb is finicky about the fields being grouped with no spaces.
meghane_e is offline   Reply With Quote
Old 07-10-2024, 07:24 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,009
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by meghane_e View Post
. . .
Does anyone know if any of the plugins do something like this already? It seems unlikely, but figured I'd ask.
. . .
Maybe the Audit Log plugin ==>> Index of plugins

BR
BetterRed is offline   Reply With Quote
Old 07-11-2024, 05:00 AM   #3
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,288
Karma: 6543210
Join Date: Sep 2020
Device: Calibre E-book viewer
Last Modified may be helpful
Comfy.n is offline   Reply With Quote
Old 07-12-2024, 03:07 PM   #4
meghane_e
Connoisseur
meghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercise
 
Posts: 86
Karma: 38050
Join Date: Sep 2016
Device: Kindle
Quote:
Originally Posted by Comfy.n View Post
Last Modified may be helpful
This is awesome to know about going forward, but for the old libraries, especially pre-2020, this plugin requires "that you must add at least one custom date column to be able to use this plugin". So anything I do now will automatically change the default last_modified column, which would defeat the goal.

For the short term, I'm going to start by making a complete CSV file for each library that contains all the preexisting data, then add a #custom_last_modified column to each library. At that point, I'll have to probably write a script to to fill in the #custom_last_modified data using calibredb and the CSV file data. If I get really ambitious, I might add some other columns like #last_merged and #last_library that get filled in by a Template function. Considering the number of old libraries and backups, maybe a small database to track data changes would be more useful. Getting into the project-creep at this point.

Otherwise, thanks for the pointers!!
meghane_e is offline   Reply With Quote
Old 07-12-2024, 04:46 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,631
Karma: 157444382
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
You could use Job Spy to backup the last modified date and then restore it after you have made the changes such as adding a custom date column.
DNSB is offline   Reply With Quote
Old 07-13-2024, 06:44 AM   #6
meghane_e
Connoisseur
meghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercise
 
Posts: 86
Karma: 38050
Join Date: Sep 2016
Device: Kindle
Create a column to record the pre-merge Last Modified date

Quote:
Originally Posted by DNSB View Post
You could use Job Spy to backup the last modified date and then restore it after you have made the changes such as adding a custom date column.
Yes!! The JS+ Backup/Restore Last Modified dates does exactly what I want! JS+ does so many things, but it could really use some UI improvements. Anyway, it was much simpler than I previously thought once I had the right tools. Here are the steps (for future me, if no one else):

1. Order of steps matters.
2. Do NOT add a new column until after you've installed Job Spy and backed up the last_modified column.
3. Choose the target library. Verify the last_modified dates are correct.
4. Backup the Last-modified dates with the JS+ plugin:
Tools that are Metadata Related > Backup/Restore Last-Modified Dates > Backup Last-modified dates

5. Add a custom column through Preferences > Add a Column. Choose Type: Long Text. Restart Calibre.

6. Restore the Last-modified dates with the JS+ plugin:
Tools that are Metadata Related > Backup/Restore Last-Modified Dates > Restore Last-modified dates
7. Select all books (ie, Ctrl+A on Windows). Hit 'E' for a bulk edit.
8. On the Seach and Replace tab:
Search mode: Regular Expression
Search field: last_modified
Search for: ()
Replace with: \1
Destination field: #your_custom_column
Save the search, for instance: "Copy Last Modified
Click 'Apply' or 'Ok'

Last edited by meghane_e; 07-13-2024 at 01:10 PM. Reason: formatting
meghane_e is offline   Reply With Quote
Reply

Tags
calibredb, dates, list, tracking


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to Export Data - Invalid Argument Error When Exporting Data zakropotch Calibre 6 06-18-2022 07:09 PM
matching last_modified with file date modified? jiembe Library Management 4 11-08-2020 09:10 AM
Cannot modify selected data within Export Calibre data Pholipe Library Management 1 09-05-2019 12:34 PM
Last_modified= 766 books today theducks Library Management 21 01-16-2014 12:57 PM


All times are GMT -4. The time now is 11:13 AM.


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