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

tags: add image's tag list #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

phweyland
Copy link
Contributor

@phweyland phweyland commented Jun 20, 2022

Started to add the image's list of tags.
The attach part is more or less done.
The detach part is started but...
First stringpool has no free feature. Attaching detaching a tag too many times would fulfill the list. Maybe not that important as it's reset at any change of collection.
Then, currently there is no collection flag to say if it's folder or tag collection. Searching where this should be done. Knowing that would also allow to display "detach image" instead of "delete image" accordingly.
Am I on a valid path ?

@phweyland
Copy link
Contributor Author

phweyland commented Jun 20, 2022

Am I on a valid path ?

I'm afraid not. Detaching (deleting) an image symlink, the corresponding real image's folder collection is not in memory. So there is no direct way to update the tags attached to an image.
It would be necessary to get the real symlink path, extract the dirname, and update the vkdt.db directly...
Any suggestion ?

@hanatos
Copy link
Owner

hanatos commented Jun 23, 2022

all that sounds valid to me. the way to attach a tag looks straight forward and i think i would have done it in a very similar way.

detaching a tag: yes, from image to tag symlink means compute the hash on the filename, the other way it's realpath(). deleting the symlink would now have to be done in lockstep with deleting the entry in the vkdt.db file. that does not sound efficient.

an alternative is: detach: just delete the link and accept inconsistent vkdt.db files in the source directories.

when opening a directory: perform a consistency pass/collect all tags by searching for the hashes in the tags subdirectories. also sounds inefficient.

i suppose this consistency pass would be needed at some point anyways because storing the same data in two places will necessarily break (if for nothing else then while debugging or after crashes).

maybe there's a more efficient way of deleting the tag from vkdt.db or a similar file? i don't think i have good answers here.

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

Successfully merging this pull request may close these issues.

2 participants