View Single Post
Old 05-07-2015, 01:07 PM   #14
Phssthpok
Age improves with wine.
Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.Phssthpok knows how to set a laser printer to stun.
 
Posts: 594
Karma: 95229
Join Date: Nov 2014
Device: Kindle Oasis, Kobo Libra II
Quote:
Originally Posted by chaley View Post
You can do what you want but it might be very slow, especially for larger libraries. Calibre will need frequently to check the format file mod times. If you sort by the column then calibre must retrieve the mod time of every format file. With that proviso ...
After being horribly busy with other things for the last few weeks I finally got around to trying this, with a slight mod (since I only edit EPUBs):
Code:
program: select(formats_modtimes('yyyy-MM-dd hh:mm:ss'),'EPUB')
This works fine, and seems to sort pretty much instantly on a library of 5000+ books. I don't know when Calibre checks the mod times, but the column updates instantly when I save a book from the editor.

The only issue I have now is that the result of all this is a string. Is there any way to turn it back into a datetime and format it nicely for display while sorting it only the underlying datetime value? datetime.strptime() would presumably do the trick if only I could import datetime somehow...

But this would just be the icing on the cake... as it is, your solution does exactly what I wanted. Thank you very much.
Phssthpok is offline   Reply With Quote