[BUG] Ordering Albums by Most Recent Photos does not work and is not persistent #1523

Closed
opened 2026-02-05 02:13:35 +03:00 by OVERLORD · 13 comments
Owner

Originally created by @nicokaiser on GitHub (Oct 28, 2023).

The bug

Ordering Albums by their Most Recent Photo seems not to work correctly. EXIF dates are correct, and the album pages display the date ranges correctly, but the albums are not ordered by the newest photos. I did not figure out how they are ordered however.

Also, when setting the search order and reloading the page, the search order is displayed as "Album title" again, although {"sortBy":"Most recent photo"} is correctly (?) saved to localStorage.

Maybe there is just some minor mapping inconsistency?

The OS that Immich Server is running on

Debian

Version of Immich Server

v1.83.0

Version of Immich Mobile App

web

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

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
      - ./external:/mnt/media/external:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped
    networks:
      - immich

  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
      - ./external:/mnt/media/external:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
      - typesense
    restart: unless-stopped
    networks:
      - immich

  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: unless-stopped
    networks:
      - immich

  immich-web:
    container_name: immich_web
    image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release}
    env_file:
      - .env
    restart: unless-stopped
    networks:
      - immich

  typesense:
    container_name: immich_typesense
    image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd
    environment:
      - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
      - TYPESENSE_DATA_DIR=/data
      # remove this to get debug messages
      - GLOG_minloglevel=1
    volumes:
      - ./tsdata:/data
    restart: unless-stopped
    networks:
      - immich

  redis:
    container_name: immich_redis
    image: redis:6-alpine
    restart: unless-stopped
    networks:
      - immich
    volumes:
      - ./redis:/data
    command: redis-server --loglevel warning

  database:
    container_name: immich_postgres
    image: postgres:15.4-alpine
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - ./db:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - immich

  immich-proxy:
    container_name: immich_proxy
    image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release}
    environment:
      - IMMICH_SERVER_URL
      - IMMICH_WEB_URL
    depends_on:
      - immich-server
      - immich-web
    restart: unless-stopped
    labels:
      traefik.enable: "true"
      traefik.http.routers.immich.entrypoints: websecure
      traefik.http.routers.immich.rule: Host(`immich.example.com`)
      traefik.http.services.immich.loadbalancer.server.port: "8080"
    networks:
      - immich
      - traefik

networks:
  immich:
  traefik:
    external: true

Your .env content

UPLOAD_LOCATION=./library
IMMICH_VERSION=release
TYPESENSE_API_KEY=...
DB_PASSWORD=...
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
TZ=Europe/Berlin
LOG_LEVEL=warn

Reproduction steps

1. Open the Albums page
2. Select the sort order menu, select "Most recent photo"
3. Reload the page

Additional information

No response

Originally created by @nicokaiser on GitHub (Oct 28, 2023). ### The bug Ordering Albums by their Most Recent Photo seems not to work correctly. EXIF dates are correct, and the album pages display the date ranges correctly, but the albums are not ordered by the newest photos. I did not figure out how they are ordered however. Also, when setting the search order and reloading the page, the search order is displayed as "Album title" again, although `{"sortBy":"Most recent photo"}` is correctly (?) saved to localStorage. Maybe there is just some minor mapping inconsistency? ### The OS that Immich Server is running on Debian ### Version of Immich Server v1.83.0 ### Version of Immich Mobile App web ### Platform with the issue - [ ] Server - [X] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" 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 - ./external:/mnt/media/external:ro env_file: - .env depends_on: - redis - database - typesense restart: unless-stopped networks: - immich 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 - ./external:/mnt/media/external:ro env_file: - .env depends_on: - redis - database - typesense restart: unless-stopped networks: - immich 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: unless-stopped networks: - immich immich-web: container_name: immich_web image: ghcr.io/immich-app/immich-web:${IMMICH_VERSION:-release} env_file: - .env restart: unless-stopped networks: - immich typesense: container_name: immich_typesense image: typesense/typesense:0.24.1@sha256:9bcff2b829f12074426ca044b56160ca9d777a0c488303469143dd9f8259d4dd environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - TYPESENSE_DATA_DIR=/data # remove this to get debug messages - GLOG_minloglevel=1 volumes: - ./tsdata:/data restart: unless-stopped networks: - immich redis: container_name: immich_redis image: redis:6-alpine restart: unless-stopped networks: - immich volumes: - ./redis:/data command: redis-server --loglevel warning database: container_name: immich_postgres image: postgres:15.4-alpine env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - ./db:/var/lib/postgresql/data restart: unless-stopped networks: - immich immich-proxy: container_name: immich_proxy image: ghcr.io/immich-app/immich-proxy:${IMMICH_VERSION:-release} environment: - IMMICH_SERVER_URL - IMMICH_WEB_URL depends_on: - immich-server - immich-web restart: unless-stopped labels: traefik.enable: "true" traefik.http.routers.immich.entrypoints: websecure traefik.http.routers.immich.rule: Host(`immich.example.com`) traefik.http.services.immich.loadbalancer.server.port: "8080" networks: - immich - traefik networks: immich: traefik: external: true ``` ### Your .env content ```Shell UPLOAD_LOCATION=./library IMMICH_VERSION=release TYPESENSE_API_KEY=... DB_PASSWORD=... DB_HOSTNAME=immich_postgres DB_USERNAME=postgres DB_DATABASE_NAME=immich REDIS_HOSTNAME=immich_redis TZ=Europe/Berlin LOG_LEVEL=warn ``` ### Reproduction steps ```bash 1. Open the Albums page 2. Select the sort order menu, select "Most recent photo" 3. Reload the page ``` ### Additional information _No response_
Author
Owner

@alextran1502 commented on GitHub (Oct 28, 2023):

Hello, are you expecting the photos to be ordered by the newest date that gets added to the album or the newest date based on the time taken of the photo?

@alextran1502 commented on GitHub (Oct 28, 2023): Hello, are you expecting the photos to be ordered by the newest date that gets added to the album or the newest date based on the time taken of the photo?
Author
Owner

@nicokaiser commented on GitHub (Oct 28, 2023):

When selecting "Most Recent Photo", I'd really be expecting the albums to be ordered by the DateTaken of the, well, most recent photo, of the album. For example (Sort descending by Most Recent Photo):

  • My Cat (Oct 28 2023-Jan 14 2018)
  • Some Vacation 2023 (June 24 2023-June 8 2023)
  • Some Vacation 2022 (July 11 2022-July 1 2022)
  • Old Photos (Nov 23 2019-Jan 20 1990)
  • ...
@nicokaiser commented on GitHub (Oct 28, 2023): When selecting "Most Recent Photo", I'd really be expecting the albums to be ordered by the DateTaken of the, well, most recent photo, of the album. For example (Sort descending by Most Recent Photo): - My Cat (**Oct 28 2023**-Jan 14 2018) - Some Vacation 2023 (**June 24 2023**-June 8 2023) - Some Vacation 2022 (**July 11 2022**-July 1 2022) - Old Photos (**Nov 23 2019**-Jan 20 1990) - ...
Author
Owner

@alextran1502 commented on GitHub (Oct 28, 2023):

Thank you for the clear explanation

cc: @martabal let me know if you want to tackle this

@alextran1502 commented on GitHub (Oct 28, 2023): Thank you for the clear explanation cc: @martabal let me know if you want to tackle this
Author
Owner

@martabal commented on GitHub (Oct 29, 2023):

Yeah, I experienced this behavior when I refactored the album page.
I will take a look after I finished my open PRs.

@martabal commented on GitHub (Oct 29, 2023): Yeah, I experienced this behavior when I refactored the album page. I will take a look after I finished my open PRs.
Author
Owner

@waclaw66 commented on GitHub (Oct 29, 2023):

Same as on mobile. It uses modified date timestamp for ordering. When you enhance an asset in very old album and reupload it again, that album appears on the top, which is not I expect. Only originalDateTime (exif) or createdDateTime (no exif) from file should be used for Most recent photos ordering otherwise one can use Last modified for tracking changes.

@waclaw66 commented on GitHub (Oct 29, 2023): Same as on mobile. It uses modified date timestamp for ordering. When you enhance an asset in very old album and reupload it again, that album appears on the top, which is not I expect. Only originalDateTime (exif) or createdDateTime (no exif) from file should be used for `Most recent photos` ordering otherwise one can use `Last modified` for tracking changes.
Author
Owner

@se3 commented on GitHub (Nov 18, 2023):

Hello,
just want to make sure we covered all known sorting issues.

  1. originalDateTime (exif) like @waclaw66 mentioned should be the base for sorting, not the createdDateTime.
  2. Renaming the album title should not impact sorting by Last modified or Most recent photos (which is the case at the moment V1.86)
    Thanks
@se3 commented on GitHub (Nov 18, 2023): Hello, just want to make sure we covered all known sorting issues. 1) originalDateTime (exif) like @waclaw66 mentioned should be the base for sorting, not the createdDateTime. 2) Renaming the album title should not impact sorting by `Last modified` or `Most recent photos` (which is the case at the moment V1.86) Thanks
Author
Owner

@se3 commented on GitHub (Nov 21, 2023):

Update V1.88:
sort by 'Oldest Photo' descending is exactly what is default in google photos, thanks for adding this feature.

@se3 commented on GitHub (Nov 21, 2023): Update V1.88: sort by 'Oldest Photo' descending is exactly what is default in google photos, thanks for adding this feature.
Author
Owner

@nicokaiser commented on GitHub (Nov 21, 2023):

Fixed in v1.88! Thanks!

@nicokaiser commented on GitHub (Nov 21, 2023): Fixed in v1.88! Thanks!
Author
Owner

@nicokaiser commented on GitHub (Nov 22, 2023):

Reverted in v1.88.2

@nicokaiser commented on GitHub (Nov 22, 2023): Reverted in v1.88.2
Author
Owner

@alextran1502 commented on GitHub (Nov 22, 2023):

@nicokaiser thank you for reopen, I forgot to do that

@alextran1502 commented on GitHub (Nov 22, 2023): @nicokaiser thank you for reopen, I forgot to do that
Author
Owner

@nicokaiser commented on GitHub (Nov 29, 2023):

Now with v1.89.0 it looks great again! Thanks again for fixing (now with faster Album loading)!

@nicokaiser commented on GitHub (Nov 29, 2023): Now with v1.89.0 it looks great again! Thanks again for fixing (now with faster Album loading)!
Author
Owner

@marconardon commented on GitHub (Jan 24, 2025):

Hello, it seems this bug has resurfaced again in v.1.125.1. Can you confirm it?

(As this is my first comment here I would like to thank all the team for its hard work!)

@marconardon commented on GitHub (Jan 24, 2025): Hello, it seems this bug has resurfaced again in v.1.125.1. Can you confirm it? (As this is my first comment here I would like to thank all the team for its hard work!)
Author
Owner

@nicokaiser commented on GitHub (Jan 24, 2025):

I can confirm there is something off with the ordering of photos in albums since 1.125.

One album that used to be ordered by date ascending was suddenly ordered by date descending, and I could not change that. I did not investigate further but I assume that rewriting large chunks of the storage layer might have caused this regression.

@nicokaiser commented on GitHub (Jan 24, 2025): I can confirm there is something off with the ordering of photos in albums since 1.125. One album that used to be ordered by date ascending was suddenly ordered by date descending, and I could not change that. I did not investigate further but I assume that rewriting large chunks of the storage layer might have caused this regression.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1523