immich-app / immich

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

timeline can be way off for large libraries #7979

Closed chodthewacko closed 1 month ago

chodthewacko commented 7 months ago

The bug

This is on windows, chrome: When you click on the timeline on the right side, the main page jumps/scrolls to that the date. When you mouse over the timeline it shows a month/year, and clicking on it sometimes takes you to the last day of that month. (which is fine).

However, sometimes it takes me to a date which is several months ahead/behind, and then I have to mousewheel scroll (which is slow) to the date I want. This is worsened by the fact that: 1) doing a 'control f' to search the date doesn't always work 2) page down kinda works, page up gets a popup box that breaks it (an option to disable that would be nice).

I'm sure this is related to the fact that I have a large library: 150K assets over 25 years,

Video of the problem: https://www.youtube.com/watch?v=TpNE7sujSKs

The OS that Immich Server is running on

windows 10

Version of Immich Server

1.98.2

Version of Immich Mobile App

1.98.2

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
      - ${EXTERNAL_PATH}:/usr/src/app/external2
      - ${EXTERNAL_PATH}:/usr/src/app/external3
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - 2380:3001
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - ${EXTERNAL_PATH}:/usr/src/app/external2
      - ${EXTERNAL_PATH}:/usr/src/app/external3
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5
    restart: always

  database:
    container_name: immich_postgres
    image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
    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=h:\immich_pics\

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

# Connection secret for postgres. You should change it to a random password
DB_PASSWORD=Pictures2000

# 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

PUBLIC_LOGIN_PAGE_MESSAGE=Welcome to the album of Boo
#EXTERNAL_PATH=d:\0temp_pic
EXTERNAL_PATH=F:\backup\pics_and_vids

Reproduction steps

1. open web page
2.  click on a date in the timeline
3.
...

Additional information

I'm sure this is related to the fact that I have a large library: 150K assets over 25 years,

jenda69 commented 7 months ago

I can confirm this. My library has about 60k items and the timeline is off too, especially for older dates.

Also my oldest photos are from 1997 and the timeline goes only to 2004 (clicking that scrolls to 2002).

Also I noticed that in these old dates, there are often fairly long stretches like "Jan 2007" which suddenly changes to "Jul 2007" even though there are photos in the months in between that (not that it matters much now when it takes me to a wrong date anyway)

alextran1502 commented 7 months ago

Each segment height is calculated based on the number of assets in that group. When it reaches a certain amount of assets, a few pixels are different when clicking on the timeline, which might make a big difference.

Regardless, this is an interesting issue to solve. Thank you for reporting

chodthewacko commented 7 months ago

Each segment height is calculated based on the number of assets in that group. When it reaches a certain amount of assets, a few pixels are different when clicking on the timeline, which might make a big difference.

There also seems to be a problem with timeline granularity. If I slowly crawl my mouse up the timeline, The timeline popup goes:

Jun 2006 Jan 2006 Dec 2005

skipping the months inbetween.

And if I click on Jun 2006 right when it changes, it goes to Jun 7, 2006 and if i click on Jan 2006 right before the switch to Jun, it goes to Jun 6, 2006 I can slowly poke my mouse down, where it still shows 'Jan 2006', but the timeline keeps moving down, until its may 7 when it jumps to the "Dec 2005' label. (probably because there are aren't a lot of pictures during Jan <-> April.)

It feels like there's a 'minimum pictures per timeline label (aka jan 2006)' thing going on, where it's adding X pictures under each label, even if that means the last picture is in a separate month.

It would be less confusing if instead of just saying 'Jan 2006' for the whole pixel block, it said, 'Jan 2006 - Jun 2006'

i poked through the code and can't figure out what page manages the timeline.

DeltaTango69 commented 6 months ago

It is very difficult to scroll to the right dates because the slider is jumping. In one moment it shoes April and then October and there are a lot photos in May, June, July. Maybe you can implement an option to make the timeline wider when there is the need. Also my first photos begin in the early 20' century. It is impossible to scroll to the beginning.

alextran1502 commented 1 month ago

fixed with #10646

jenda69 commented 1 month ago

Works much much better now. Not 100 % though - if I click on 01/2006, it moves the timeline to 04/2006. But there's not that many old photos on my timeline so the correct month is just like one screen away.