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

feat: add an option to store rclip DB alongside of the indexed images #36

Open
josalhor opened this issue Feb 24, 2023 · 3 comments
Open
Labels
enhancement New feature or request priority:medium Medium priority issues

Comments

@josalhor
Copy link

Hello!

I have noticed that rclip saves the database based on an environment variable or a system data directory:

def get_app_datadir() -> pathlib.Path:

Is there any reason why we can't configure rclip to save the database on the current directory ala git? If I am not mistaken, that would allow users to move/copy these folders and keep a database of the cached images. This would be really useful if someone managed their albums through a cloud platform, allowing them to also upload the database file and share it across devices.

@yurijmikhalevich
Copy link
Owner

Hi @josalhor! I like your suggestion.

Right now, you can configure this by adding an environment variable to your .bashrc or .zshrc on the machines you are using rclip on, like:

export RCLIP_DATADIR=<path to your photos>/.rclip

If we go this way by default, we will need to either search parent dirs for the database if you perform a query in a subdir or to keep lots of smaller indexes in every subdir. Having multiple smaller indexes will negatively impact the query time when you search in a parent directory. Maybe, going the first way will make more sense, given performance implications 🤔

@josalhor
Copy link
Author

josalhor commented Mar 2, 2023

Hi @josalhor! I like your suggestion.

Right now, you can configure this by adding an environment variable to your .bashrc or .zshrc on the machines you are using rclip on, like:

export RCLIP_DATADIR=<path to your photos>/.rclip

This would work for a single directory, but if you have multiple disjoint directories that would not work!
The alternative would be to make the path to your photos point to your CWD, that may do the trick but I am not sure it is the most elegant solution.

If we go this way by default, we will need to either search parent dirs for the database if you perform a query in a subdir or to keep lots of smaller indexes in every subdir. Having multiple smaller indexes will negatively impact the query time when you search in a parent directory. Maybe, going the first way will make more sense, given performance implications thinking

I didn't actually imagine this in a recursive fashion with nested directories in mind. I was thinking purely about the idea of having multiple disjoint albums that you want to query and share separately. I wonder if we would need to implement to some kind of rclip init to establish an empty database in the current directory (again, ala git). Otherwise it is not clear to me how you would clearly communicate to the user the database directory

@yurijmikhalevich
Copy link
Owner

@josalhor, rclip init is the first thing that comes to mind, but it will introduce additional friction to using rclip which I would love to avoid. I will think about the performant way to implement the recursive index.

@yurijmikhalevich yurijmikhalevich added enhancement New feature or request priority:medium Medium priority issues labels Jul 11, 2023
@yurijmikhalevich yurijmikhalevich changed the title Rclip Saving Directory feat: have an option to store rclip DB by the indexed images Aug 10, 2023
@yurijmikhalevich yurijmikhalevich changed the title feat: have an option to store rclip DB by the indexed images feat: add an option to store rclip DB by the indexed images Aug 10, 2023
@yurijmikhalevich yurijmikhalevich changed the title feat: add an option to store rclip DB by the indexed images feat: add an option to store rclip DB alongside of the indexed images Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:medium Medium priority issues
Projects
None yet
Development

No branches or pull requests

2 participants