-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort the deleted files by date #3
Comments
Thank you! Being able to sort by deletion date would be a very useful feature indeed. Unfortunately, it's currently not possible to get the deletion date through Obsidian's file API, which makes the feature difficult to implement reliably. I'm gonna add a little background info here because this blocks implementing #2 as well. Obsidian provides the "mtime" and "ctime" timestamps for each file. mtime means "modification time", which updates when the file contents are modified, but ctime is platform-dependent. On Linux/Mac it updates when the contents or attributes change, on Windows it's the creation time. Neither of these can reliably be used as a deletion date. So we'll have to track deletion ourselves. One possible implementation would be something like:
This would work as long as files are deleted from within Obsidian, but there are some cases that will produce an incorrect deletion date, for instance:
These scenarios are probably convoluted enough that the issues are acceptable, but it's important to acknowledge that Obsidian's vaults are supposed to be interoperable. Additionally, Obsidian Sync won't sync the .trash folder, but synchronization tools like iCloud will, so the plugin needs to prevent two machines from overwriting each other's deletion dates. Either it will have to distinguish between sync providers (and reuse the deletion dates only when the So there are a couple of challenges associated with this feature. If anyone wants to take a stab at implementing it or has ideas for a more reliable technique, let me know :) |
Thanks for following up. I see Obsidian has API limitations. Also, it seems that the feature needs different implementation for each OS. For my use case, I thought another idea might be to provide search bar at the top so a user can filter the file they want to restore. They can search by file name in the shown files list which will easily help to find the deleted file. It's the next good enough solution I thought. |
Hi again, I just released a new version of the plugin that contains a search bar. I hope it's of use to you :) |
I would love to see the ability to sort deleted files by date . This would be incredibly helpful for managing and organizing files within the plugin. The ideal outcome is to have the recently deleted files at the top of the list. It's useful to quickly restore an accidently deleted file.
Also, your plugin been an invaluable tool for me and I appreciate the effort you have put into creating and maintaining it.
The text was updated successfully, but these errors were encountered: