View Single Post
Old 04-11-2020, 04:54 PM   #32
kcarscadden
Zealot
kcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavenskcarscadden is a rising star in the heavens
 
kcarscadden's Avatar
 
Posts: 141
Karma: 13776
Join Date: Jan 2007
Location: semi-north Ontario, Canada (N 45.41 W -79.67)
Device: iPad Air 5, Samsung Galaxy S20 FE
To sum up for anyone else that would like to search on the file date of the epub:

Use Preferences / Create a custom column to create a column, using program: select(formats_modtimes('yyyy-MM-dd hh:mm:ss'), 'EPUB') as the template. See attachment.

Install plugin MultiColumnSearch https://www.mobileread.com/forums/sh...d.php?t=261712

Install plugin Save Composite Custom Columns https://www.mobileread.com/forums/sh...d.php?t=272575

Customize Save Composite Custom Columns to run for the library - Preferences / Advanced - Plugins / Library closed plugins, click on Save Composite Custom Columns , click on Costomize plugin, ensure that Run plugin is clicked.

Exit from Calibre, restart Calibre, verify that new column appears, Exit from Calibre, restart Calibre, (not sure if this last exit/restart is necessary, but it certainly won'tn hurt). This ensures that the custom column gets updated into the Calibre database - metadata.db.

Use plugin MCS with SQL Query similar to the following:

SELECT book
FROM books_plugin_data, books
where val is NOT null
AND books_plugin_data.book = books.id
AND PARSEJSON(val, '#tt') > datetime(timestamp, '-4 hours')
AND timestamp > strftime('%Y-%m-%d', '2019-01-01')

#tt is the custom column I created for the epub file date.
timestamp is the date the book was added to the library, stored as UTC, so for me, 4 hours ahead. Calibre displays this in the UI as the current timezone.
PARSEJSON(val, '#tt') > datetime(timestamp, '-3.75 hours') finds books where the file date/time is greater than the date/time the book was added to the library plus 15 minutes. This allows time for initial processes in the Calibre library such as (ahem ...DRM removal ...) or conversion.

Adjust for your own processes/needs.

Note that you will have to exit/restart Calibre any time you have modified an epub to get the correct results in MCS.

(Thanks for all the help from Chaley, DaltonST, BetterRed, JSWolf, PeterT, stumped and theDucks.)
Attached Thumbnails
Click image for larger version

Name:	cc.jpg
Views:	66
Size:	102.2 KB
ID:	178308  
kcarscadden is offline   Reply With Quote