immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.63k stars 2.17k forks source link

Upload a duplicate of a trashed element doesn't untrash it #6639

Closed MK73DS closed 3 days ago

MK73DS commented 7 months ago

The bug

I am not sure if this is expected behavior or not, but from a user perspective it is very confusing. If I put a picture in the trash and then try to manually upload it again, Immich says the file already exists, but it stays in the trash and doesn't appear in the library. I think a user manual upload should always put the picture or video in the library and untrash it if necessary.

The OS that Immich Server is running on

Arch Linux (6.7.0-arch3-1)

Version of Immich Server

v1.93.3

Version of Immich Mobile App

v1.93.3

Platform with the issue

Your docker-compose.yml content

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2283:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    extends:
      file: hwaccel.yml
      service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /DATA:/mnt/DATA:ro
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:80cc8518800438c684a53ed829c621c94afd1087aaeb59b0d4343ed3e7bcf6c5
    restart: always

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: always

volumes:
  pgdata:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=/ImmichDrive/library

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secrets for postgres and typesense. You should change these to random passwords
TYPESENSE_API_KEY=[redacted]
DB_PASSWORD=[redacted]

# The values below this line do not need to be changed
###################################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

REDIS_HOSTNAME=immich_redis

Reproduction steps

1. Put in the trash a picture
2. Upload it manually through the web UI

Additional information

No response

jrasm91 commented 7 months ago

I would not be opposed to adding this. Basically if it is a duplicate and it is trashed, still return the same thing and stuff, but untrash it in the background?

MK73DS commented 7 months ago

Yes, that seems logical to me. Or at least inform the user that the duplicate file is in the trash and ask if they want to untrash it. Drag-and-dropping an image into Immich and not getting it in the library because it's already there but trashed can be very confusing, especially if trashed by accident or by another person who shares the same account.

srwareham commented 6 months ago

Not to be contrarian, but I actually strongly prefer to not have explicitly deleted photos reintroduced to immich. I have so many photos where I took ~3 nearly identical photos. Prior to immich, these were backed up automatically in a way where deletions weren't synced. I periodically find old harddrives and want to make sure all of my photos are in immich--except the ones I've explicitly deleted.

Maybe this could be a toggleable configuration? Potentially even at the file-level? e.g., it might be helpful to have a list of previously deleted files accessible anyways? Maybe just a list of file attributes assuming the actual image file was deleted. Could be something like hash, filename, create date?