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

Closed
wants to merge 10 commits into from
Closed

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

@simulot
Copy link
Owner

simulot commented Oct 28, 2024

The immich-go next version is more mature now.
Could you envisage to port the tag functionality in the next branch?
Feel free to discuss this

@simulot
Copy link
Owner

simulot commented Oct 28, 2024

Don't rush on it... I'm still shaking the code

@benjamonnguyen
Copy link
Author

If you don't mind, do you have a summary of the direction your taking with this next branch?

@benjamonnguyen
Copy link
Author

I'll move the changes onto the next branch but you can look at my latest commits if you want to see the new tag command's options and implementation.

@simulot
Copy link
Owner

simulot commented Oct 29, 2024

I changed completely the command line management.
I think I made it too difficult for a easy merge.
I'll do it.

@simulot
Copy link
Owner

simulot commented Oct 31, 2024

I'm ready to merge your PR.
The next branch is so different now, than I don't know where to start while keep you credited for the feature.

@benjamonnguyen
Copy link
Author

Are you going to merge next into main branch?

@simulot
Copy link
Owner

simulot commented Oct 31, 2024

Can we chat on discord?

@benjamonnguyen
Copy link
Author

Sure can you link me to the channel?

@simulot
Copy link
Owner

simulot commented Nov 1, 2024

I'm reviewing your PR in details.

1/ I'm sorry for having shacked all the source while you have worked on it.
2/ I would like to include the tag functionality in the upload command. Then it will be available for any source of photos
3/ I'm think to group immich editing functions like tag maintenance, raw/jpeg cleaning, stack bursts....

My channel is @simulot, Paris time zone.

@benjamonnguyen
Copy link
Author

Linking to #522

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