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

Feature/tags #512

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

benjamonnguyen
Copy link

@benjamonnguyen benjamonnguyen commented Oct 16, 2024

Description

image

Verification

test command: immich-go upload -tags="test" -tag-with-session -tag-with-path ~/test
immich-go-tags

@tobiasgraeber
Copy link

tobiasgraeber commented Oct 20, 2024

@benjamonnguyen Maybe also add the new option by something like -tags="YOUR-TAG-NAME" to the readme.md table which lists common commands like here ?: https://github.com/benjamonnguyen/immich-go/tree/feature/tags?tab=readme-ov-file#shared-options-with-all-commands

@simulot Can this be merged please?

Thx!

@benjamonnguyen
Copy link
Author

@tobiasgraeber updated the readme!

@benjamonnguyen
Copy link
Author

Let's actually hold off on merging this.

I'm seeing an issue where sometimes assets aren't being tagged.

Opened an issue here: immich-app/immich#13633

@simulot
Copy link
Owner

simulot commented Oct 21, 2024

I'm wondering if it possible to leverage the tagging system to track immich-go uploads, and implement a kind of UNDO.

@benjamonnguyen
Copy link
Author

benjamonnguyen commented Oct 21, 2024

I can definitely see immich-go upload -tag-session tagging all uploaded assets with the same format log files are suffixed with. Then immich-go delete -tags=20241022xx.

I can add the -tag-session flag to this PR.

@benjamonnguyen
Copy link
Author

benjamonnguyen commented Oct 22, 2024

@simulot implemented tag-session flag:
image

For now I've had to add a 5 second sleep. It looks like there's a race condition where the assets are being moved out of the upload directory into the library directory resulting in a stale path when the tagAssets request is made.

Waiting on a response from the immich team.

@simulot
Copy link
Owner

simulot commented Oct 22, 2024

@simulot implemented tag-session flag: image

Nice!
The session tag could be hierarchical has well. All upload would be under one master tag like "immich-go/session_2006-01-02_15-04-05"

For now I've had to add a 5 second sleep. It looks like there's a race condition where the assets are being moved out of the upload directory into the library directory resulting in a stale path from the tagAssets request is made.

Waiting on a response from the immich team.

Let's see how the discussion goes.

@simulot
Copy link
Owner

simulot commented Oct 22, 2024

Thinking loud:
Imagine your personal collection of assets is sorted patiently by years, topic and so one...
2009 / Petrified forest
2009 / Grand canyon
2009 / Cousins meeting
...

Using the path as tags makes sense, isn't it?

@benjamonnguyen
Copy link
Author

benjamonnguyen commented Oct 22, 2024

Using the path as tags makes sense, isn't it?

Silly of me to not think of this considering it's what motivated this PR in the first place. My wife has her folder structure like

|--Holidays
   |-- New Years
   |-- Halloween
   |-- Thanksgiving

and simply providing a flag -tag-by-path would be ideal.

Running list of possible flags...
-tag-by-path
-tag-with-session
-tags

@benjamonnguyen
Copy link
Author

@simulot Got a workaround from an immich maintainer (immich-app/immich#13637 (reply in thread))

If things look ok to you, I think it's mergeable

@agittins
Copy link

How about a -tag-by-path-separators to further split the path component by a given set of chars?

My existing archive has folders named 2024/2024-02-05-event-name-or-such, and I have subfolders named out for results of processing.

If that's a bit esoteric it's no problem for me, as I'll just use a bash script to call immich-go for each folder separately, building the tags list for each folder as it goes.

But either way, I'm keen to see this merged! :-)

@benjamonnguyen
Copy link
Author

@agittins I think the 3 current flags covers our bases and a bash script leveraging them would be a cleaner

@benjamonnguyen
Copy link
Author

benjamonnguyen commented Oct 26, 2024

@simulot after using it to upload and tag a few of my wife's albums, I think it'll be a cleaner CLI to break it out into its own tag command and treat it as a two step process. Upload then tag. Am also planning to implement -remove-tags=LIST and -tag-cleanup.

@simulot
Copy link
Owner

simulot commented Oct 27, 2024

This could be one of the maintenance tools that we can propose through immich-go

fyi: I'm still on the code reorganization

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.

Feature request: Add tag to uploaded files
4 participants