immich
immich copied to clipboard
mobile: fall back to mtime rather than ctime when no EXIF date is present
The bug
~~Luckily, I was still testing things out but when I added other local albums on my phone, the photos' dates weren't their mtime or exif dates but the mtime of the directory containing the photos.~~
Edit: Far more detailed pdate below.
The OS that Immich Server is running on
NixOS
Version of Immich Server
v1.94.1
Version of Immich Mobile App
v1.94.1
Platform with the issue
- [ ] Server
- [ ] Web
- [X] Mobile
Your docker-compose.yml content
# Modified version of https://github.com/immich-app/immich/releases/download/v1.93.3/docker-compose.yml
version: "3.8"
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: 'no'
logging:
driver: json-file
immich-microservices:
container_name: immich_microservices
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
command: ["start.sh", "microservices"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
depends_on:
- redis
- database
restart: 'no'
logging:
driver: json-file
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: 'no'
logging:
driver: json-file
redis:
container_name: immich_redis
image: redis:6.2-alpine@sha256:c5a607fb6e1bb15d32bbcf14db22787d19e428d59e31a5da67511b49bb0f1ccc
restart: 'no'
logging:
driver: json-file
database:
container_name: immich_postgres
image: tensorchord/pgvecto-rs:pg14-v0.1.11@sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee
env_file:
- .env
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
volumes:
- pgdata:/var/lib/postgresql/data
restart: 'no'
logging:
driver: json-file
volumes:
pgdata: null
model-cache: null
Your .env content
DB_DATABASE_NAME=immich
DB_HOSTNAME=immich_postgres
DB_PASSWORD=postgres
DB_USERNAME=postgres
IMMICH_VERSION=release
REDIS_HOSTNAME=immich_redis
UPLOAD_LOCATION=/var/lib/immich/
Reproduction steps
(Not sure if 1-3 matter but I added them for completeness sake; it's all I did with the app.)
1. Have existing photos uploaded from PC
2. Add local album which contains these photos too
3. Wait for sync
4. Add a few other albums with photos from varying dates
5. Let it sync
6. Photos of the other albums all have the same date
Additional information
I first thought it was the mtime of the newest file in the directory but it was the same date for multiple local albums; the date I restored a backup on my phone.