View Single Post
Old 01-11-2020, 01:50 AM   #556
Marco77
Connoisseur
Marco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipseMarco77 can illuminate an eclipse
 
Posts: 55
Karma: 8430
Join Date: Mar 2016
Device: PW3, Clara HD, PB740
Lightbulb 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
Attached Files
File Type: zip ui-py.zip (2.0 KB, 192 views)
Marco77 is offline   Reply With Quote