Function to retrieve timestamp from filesystem
Hello there,
Thank you for this PI, I've used it sporadically a few years ago and it was useful.
I believe my whole library was modified by adding a custom column recently, and since my default view is sorted by last modified, the ordering is in complete shambles.
Cue Job Spy, but ofc I don't have a backup of those timestamps, furthermore copying from "added time" yields a bit unsatisfactory results, with quite a few empty fields.
So... long story short, I patched the code to add a new function. It retrieves the timestamp from filesystem, assuming it will be authoritative.
- It takes the most recent timestamp found amongst available formats; no action is taken if no file was found
- the file path is computed using "self.guidb.format_abspath" but I left over the libpath path construction code, you might want to clean this up by choosing whichever preferred way
- all queries are wrapped in a single transaction, so it's do-or-die
- apsw cannot prepare queries using datetime objects? Had to manually force the str() conversion. It seems fine when browsing using sqlite3
|