Skip to content
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

Collection / Directory Reloading #105

Open
IonoclastBrigham opened this issue Feb 7, 2019 · 1 comment
Open

Collection / Directory Reloading #105

IonoclastBrigham opened this issue Feb 7, 2019 · 1 comment

Comments

@IonoclastBrigham
Copy link
Collaborator

Sometimes, a collection will change on disk while browsing through it with Ivy, e.g. you import your camera contents while browsing through your raw photo dump directory, or you delete some duplicates. It is desirable for the collection to be reloaded without having to go through the hassle of re-selecting all relevant directories and files from one or more system file dialogs.

Logic Rules and Behaviors

When reloading the current collection Ivy MUST...

  • remember how a file came to be in the collection (i.e. as part of a directory vs. individually selected)
  • add/remove any added/removed files in opened directories
  • remove any removed files that were previously explicitly added to the collection

If possible and practical, Ivy SHOULD...

  • maintain stable ordering for unchanged files, relative to each other
  • try to remember the currently-viewed file, and land there again after the collection is rebuilt
  • reload the current file, if it has changed (i.e. external editor, or as a result of file-moving/renaming)
  • update the collection automatically

UX

This feature could be completely manual, triggered on-demand by one or more of a menu item, a toolbar button, and an accelerator key combo. This would be a reasonable enough choice as the user should know when they've made changes to their image collections on disk, but the real value-add is automating the whole thing.

One could periodically poll for changes, but for very large directories this doesn't scale very nicely. The better alternative would be to "watch" the appropriate files and directories, and react to changes in an event-driven manner.

A quick search did not reveal a racket-native (or via FFI) solution that works across platforms, but further research may lead to a suitable open source solution.

@lehitoskin
Copy link
Owner

One thing to watch out for is that Ivy will modify files by editing the embedded XMP data in a given file, so we should also do some sort of delay on an event-based refresh when Ivy knows it's also been modifying metadata for files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants