Open AkbarTheGreat opened 1 year ago
Is the library a tree or a single directory? Would this have to keep track of a very large number of files in some situations? Would a refresh button be simpler?
So the current setup is to add all images by hand, there's no automation for finding images at all currently, so whatever system does stuff will have to look at the filesystem and make some choices regardless of if it's a refresh button or a thing that happens at startup.
The data structure is here, and doesn't use too much crazy Protobuf magic so it's probably intuitive to read, but in case it's not, the library object holds a string that represents the root of the library and a list of library entries, each entry contains information about that given image. The Boston file structure is a tree, so I'd support traversing into directories**, but a flat structure would just be a trivial case of traversal.
** Likely directory traversal will be run with a maximum depth rather than an actual cycle detection, in case of linked directories, because cycle detection can be difficult and I don't know if I have the time to dedicate to that
Good point about recursion; I suppose you could just ignore links if you wanted to just avoid the chances of looped recursion, but Linux and MacOS users might not like having the option to use links taken away. Windows users might use them too, but most likely don't even know hard or soft links are possible.
JANIS refreshes by either double-clicking the image library count (old versions) or by clicking on a little refresh icon (newer versions), for whatever that info is worth. I am starting to grow leery of me talking about my own program here, as it sounds a bit vain and braggy; I hope that it comes across more as what I've learned in the journey, but if I sound arrogant let me know.
Now that the image library has a concept of a root directory, we could have it look for new files in that directory at startup, if it exists. This would simplify the use case where a user just drops files into that directory and expects them to show up without any additional effort.