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(web): synchronise metadata and album membership between duplicate images #13851

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

Conversation

EinToni
Copy link

@EinToni EinToni commented Oct 31, 2024

Description

This is my first time contributing here and I hope it is ok to open a PR without creating an issue. This PR arises from the feature request #10262 and in part from #10206. In both more information is wished as well as the possibility to synchronize metadata between the duplicated images.

PR Content

This PR introduces the ability to automatically:

  • Synchronize the albums of duplicated images
    • Meaning: The deduplicated images are all put in all albums any duplicate was part of.
  • Synchronize the favorites
    • Meaning: If any of the duplicates was marked as favorite, the deduplicated images are also marked as favorites.
  • Synchronize the archive
    • Meaning: If any of the duplicates was archived, also archive the deduplicated images.

These three settings can be individually toggled:
image

I also added an indicator for the archive status of any image, same as the favorites icon:
image

And lastly I added the possibility to manually select the date/time, description and location to be synched to the deduplicated kept images. I am not that happy with this solution, but these are all fields that could completely differ from each other so no automatic resolution seemed fitting here.
image
In this example the remaining two images would be marked as favorites, marked as archived, have the location set to Paris, the description to "thisis some test" and the timestamp to 9. Jan. 2023 Mo, 07:15.

Open work

The size of the showed duplicates can now vary and therefore not align with each other. This looks very bad, but I didn't find any nice way to fix this (it's my first time using svelte and I'm not doing web development too often).

* Synchronization can be toggled
* All images in the deduplication process will be added to all albums.
  Afterwards all images (if deleted or not) will be in the same albums.
* Moved the toggle into a separate options window.
* Added capabilities to sync the favorite status as well as the archived status.
* Added visual indicator next to the favorite icon if the image is archived.
* Added positibilty to select the date/time, the description and the
  location to optionally sync. Equal data in duplicate data is highlighted
  in green. Different data (that gets overwritten) in red.
* ToFix: Alignment of the single duplicates is not nice.
@bo0tzz bo0tzz changed the title feat(web): Synchronise metadata and album membership between duplicate images feat(web): synchronise metadata and album membership between duplicate images Oct 31, 2024
@bo0tzz
Copy link
Member

bo0tzz commented Oct 31, 2024

Cool stuff, thank you!

The UI is a little unclear to me at the moment, I'm hoping @alextran1502 has some ideas there. My suggestion would be to separately display another card showing what the deduplicated end result will look like. Just a super quick and dirty browser devtools mockup:
image

@EinToni
Copy link
Author

EinToni commented Nov 4, 2024

Thank you for the suggestion! I like it and it looks great in your example. But where should we put the "preview" card when there are more duplicates (like in my initial example)? The best would probably be to put it below the rest, but I don't know how clean the look then would be.

Also after looking at this again after almost a week, the red and green highlights really clutter up the UI. My idea was to highlight the metadata in red that gets "lost", as it will be overwritten by other data. But I would say removing the red highlighting in favor for proper lineup of the fields will help the readability quite a lot.

I will give the lineup of the data another try and remove the red highlights. Afterwards I can put in your preview card to see how it feels in action.

* Synched the height of the description and the location of the duplicates, as these can differ between duplicated.
* Added rounded edges to the highlighting to match the rest of the UI.
* Removed red highlight of any differing metadata.
* Added only red highlight to the metadata field that get overwritten on the selected assets as these get overwritten.
* Added preview of the favorite and archive icon on selected assets.
@EinToni
Copy link
Author

EinToni commented Nov 5, 2024

I decided against a separate preview asset because I saw an example on my regular immich instance, where some duplicates are looking visually slightly different. There I want to keep e.g. 2 of 5 images. Showing this in a single preview would only confuse as I would have to pick some image to diplay.

I therefore opted to display the preview directly in the selected assets (and only in the selected ones). Previously I highlighted all metadata that is different from the selected one. Now only the selected assets reflect the changes that will be done. In my opinion this has improved the usability a lot.
I also adapted the shape of the highlight to match the rest of the UI.
image

Usability feels better:
https://github.com/user-attachments/assets/c5b02bdb-73e8-4d9f-9e89-7f109552fb07

I would be happy about further feedback :)

@bo0tzz
Copy link
Member

bo0tzz commented Nov 5, 2024

Good stuff!

There I want to keep e.g. 2 of 5 images. Showing this in a single preview would only confuse as I would have to pick some image to diplay.

What about displaying both?

@EinToni
Copy link
Author

EinToni commented Nov 5, 2024

Displaying every selected asset is another "preview" card would clutter up the UI quite quickly. And when selecting/deselecting some duplicates the previews would probably dynamically pop up and vanish, dependent on the amount of selected duplicates. This could lead to a lot of confusion and also distinguishing between the previews to tell which preview relates to which duplicate could then become harder than necessary.
Therefore I would say a direct preview of the changes in the already existing displays is better.

@mertalev
Copy link
Contributor

mertalev commented Nov 5, 2024

Wow, awesome stuff! My thought is that the syncing for albums, favorites, etc. is relatively straightforward while metadata is harder to display and edit in an intuitive way. What do you say about handling the former in this PR and the latter in a separate PR?

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

Successfully merging this pull request may close these issues.

3 participants