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-26-2018, 03:49 PM   #16
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 22,272
Karma: 22142024
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: K4NT, Galaxy Tab A
last_modified will update if you run Library maintenance .

There is so much that triggers that status.
Using the OS dir recursive on the Library and feeding that to a script is the best I can think of
dir <librarypath> /s/w
theducks is online now   Reply With Quote
Old 08-26-2018, 06:19 PM   #17
bodiccea
Member
bodiccea began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Aug 2018
Device: samsung tablet 8", kitkai
This is exactly what I did in the script above, but with calibre book insertion date instead of last_modified that I lost as you know.

Still not acceptable, but better than nothing. As I said, I will try to find where is stored this "last_modified" information, to try to correct it from an older backup. Using a "MAX()" will be a plus if it is true that book insertion date in calibre could change too in some situations (not sure of that, but I did read something about it, I forgot where).

But if you know where it is, I will take it :-) Surely not in the metadata.opf, I just made a test. So it should be in the epub file itself

Just found something: In main DB (metadata.db, a SQLite 3.0 database, which is at the root of your library). The table "Books" seems to contain this "last_modified" field. Too late today, but I will confirm with a few books after making some metatadata changes. If confirmed, it will be easy to extract this date from the DB.

bod.

Last edited by bodiccea; 08-26-2018 at 06:42 PM.
bodiccea is offline   Reply With Quote
Advert
Old 08-26-2018, 07:24 PM   #18
BetterRed
null operator
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: 11,311
Karma: 10578436
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@boudicca - the 'timestamp/Date' is set to the system timestamp when the book is first added to the database, after which it isn't changed by calibre internally. However it is user modifiable. Some users re-purpose it to be the date they finished reading the book. Some re-purpose it to be the date they purchased the book, which may be before or after they added the 'book' record to the database.

It is almost certain that you didn't 'lose' calibre's last_modified date in your books, you did something (singular) that rippled (propagated) a metadata change through multiple (all) books. It will happen again.

BR
BetterRed is offline   Reply With Quote
Old 08-27-2018, 06:43 AM   #19
bodiccea
Member
bodiccea began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Aug 2018
Device: samsung tablet 8", kitkai
@BetterRed,

I know it did not disappear by magic. It you re-read the thread, I wrote before (message #10):

Quote:
The issue is the {last_modification} field is wrong (a mistake from me somewhere, don't know what,when, and why). So I need first to restore them.
So now, the *only* issue is to fix the metadata.db database.
bodiccea is offline   Reply With Quote
Old 08-27-2018, 08:16 AM   #20
BetterRed
null operator
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: 11,311
Karma: 10578436
Join Date: Mar 2012
Location: Sydney Australia
Device: none
I just wanted to be sure you understood that some changes can result in the last_modified date being updated for every book in a library.

For example if you have a column with a fixed set of values, (red, blue, green) and you decide to add some values to the allowable values (black, white), then every book in the library will have its last_modified value set to system time when you committed the change to the column definition.

It was that 'feature' and a couple of other's that led me to create my '#last_change' column, which incidentally has a companion column '#what_changed'.

BR

Last edited by BetterRed; 08-28-2018 at 05:34 AM.
BetterRed is offline   Reply With Quote
Advert
Old 09-01-2018, 05:09 AM   #21
bodiccea
Member
bodiccea began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Aug 2018
Device: samsung tablet 8", kitkai
Solution chosen

@BetterRed,

I decided the lazy way, there are dependencies in database (which prevents to change directly the last_modified field, and I don't want to spend time to look at them in the code.
I simply removed all my libbrary, restored a 2 months old DB (with the books) of that time.
A few books (less than 10) are missing, but it will be easy to find which ones, as I removed them from ZZ-TODO on https://ebooks.raoult.com when I moved them to my own DB.
I will compare the missing files in ZZ-TOTO to those present 2 months ago, so I will take seconds to add them again.
I changed also the template to export to disk to:

{languages}/{:'format_date(raw_field('last_modified'),'yyyyMMd dhhmm')'}-{author_sort} - {series:|(| } {series_index:0>2s|#|) - }{title}

There was no other way to get a full date/time for last_modified, as interface "Export to Disk", the field "File Format to save" is just a limited one, with only %Y, %b, %m, %d available (year, month name, month number, and day number). I don't understand why they don't use the same format as format_date() function, as the function exists.

First I will create DB for the 2 sets in ZZ-TODO to remove the duplicates with my own library, I believe there are thousands. Not urgent, I will improve my own backup script first,

Subject closed then..

br.

Last edited by bodiccea; 09-01-2018 at 05:11 AM. Reason: added link
bodiccea is offline   Reply With Quote
Reply

Tags
calibre, export date format

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Add a book" template like "Save to disk"? vr8ce Library Management 10 06-09-2017 09:16 AM
Title format in "save book to disk"? Phssthpok Library Management 5 11-26-2014 06:18 AM
Request: separate "Preferred output format" from "Save to Disk" format Katsunami Calibre 2 08-24-2014 12:23 PM
"Save single format to disk" trouble vbdasc Calibre 2 12-01-2010 03:30 AM
Propagate a new "Save to Disk" Folder Structure using Calibre? Trickery Calibre 3 09-11-2010 10:27 PM


All times are GMT -4. The time now is 07:24 AM.


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