Sign inSign up

rouhim/this-week-in-past

By rouhim

•Updated 8 days ago

Aggregates images taken this week, from previous years and presents them on a slideshow.

Image
3

100K+

rouhim/this-week-in-past repository overview

CI CI Docker Pulls Docker Image Size (tag) os-arch Online demo Donate me Awesome

Aggregate images taken this week, from previous years and presents them on a web page with a slideshow.

⁠Motivation

When I migrated my photo collection from google photos to a locally hosted instance of photoprism, I missed the automatically generated slideshow feature of google photos, here it is now.

⁠How it works

The meta information of all images are read at startup and cached in memory. When the slideshow is opened, images from this calendar week from previous years are displayed. If no images from the calendar year are found, random images are displayed.

⁠Run the application

⁠Docker

Docker Example:

docker run -p 8080:8080 \
        -v /path/to/pictures:/resources \
        -e SLIDESHOW_INTERVAL=60 \
        -e WEATHER_ENABLED=true \
        -e OPEN_WEATHER_MAP_API_KEY=<YOUR_KEY> \
        rouhim/this-week-in-past

Docker compose example:

services:
  this-week-in-past:
    image: rouhim/this-week-in-past
    volumes:
      - /path/to/pictures:/resources:ro # mount read only
    ports:
      - "8080:8080"
    environment:
      SLIDESHOW_INTERVAL: 10
⁠Native execution

Download the latest release for your system from the releases page⁠:

# Assuming you run a x86/x64 system, if not adjust the binary name to download 
LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/RouHim/this-week-in-past/releases/latest | \
sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') && \
curl -L -o this-week-in-past https://github.com/RouHim/this-week-in-past/releases/download/$LATEST_VERSION/this-week-in-past-x86_64-unknown-linux-musl && \
chmod +x this-week-in-past

Create a folder to store the application data:

mkdir data

Start the application with:

RESOURCE_PATHS=/path/to/pictures \
DATA_FOLDER=data \
SLIDESHOW_INTERVAL=60 \
./this-week-in-past

Offline city lookup: For native execution download the derived place dataset once:

curl -fL https://github.com/RouHim/this-week-in-past/releases/latest/download/geodata.txt -o geodata.txt

or build it from the upstream GeoNames dumps (downloads cities500.zip and allCountries.zip once, result ~17 MB):

bash .container/build-geodata.sh ./geodata.txt

and run with GEODATA_PATH=$(pwd)/geodata.txt (defaults to /geodata.txt in the container). Without the file city resolution is disabled with a warn! log.

Since the binary is compiled completely statically⁠, there are no dependencies on system libraries like glibc.

BREAKING CHANGE: BIGDATA_CLOUD_API_KEY is deprecated and ignored since the offline city-resolution migration. Remove it from docker run -e / compose.yaml / .env at your convenience — offline lookup needs no API key or network. CITIES500_PATH is no longer read: the app refuses to start while it is set, and the error names the variable and GEODATA_PATH. Native execution now requires the one-time download above; container image already bakes /geodata.txt (+~17 MB).

⁠Configuration

All configuration is done via environment variables:

NameDescriptionDefault valueCan be overwritten in URL
RESOURCE_PATHSA list of folders from which the images should be loaded (comma separated)/resources (Container only)
DATA_FOLDERPath to a folder where the data should be stored, needs read/write access/data (Container only)
PORTPort on which the application should listen8080
SLIDESHOW_INTERVALInterval of the slideshow in seconds30x
REFRESH_INTERVALInterval how often the page should be reloaded in minutes (triggers a new slideshow playlist)360 (6h)
DATE_FORMATDate format of the image taken date (https://docs.rs/chrono/0.4.19/chrono/format/strftime/index.html⁠)%d.%m.%Y
BIGDATA_CLOUD_API_KEYDeprecated — ignored; the offline GeoNames place dataset (CC BY 4.0, https://www.geonames.org⁠) is used. Remove from env/compose at your convenience.
GEODATA_PATHPath to the derived #twip-places-v1 place dataset (GeoNames cities500.zip + allCountries.zip) for offline city/district lookup; the container bakes /geodata.txt, native installs fetch or build it (see "Offline city lookup")./geodata.txt
HOME_COUNTRYHome country (ISO 3166-1 alpha-2 code⁠, e.g. DE): same-country photos show no country suffix, foreign photos append the English country name. Unset shows no country suffix; invalid codes fail fast at startup.
WEATHER_ENABLEDIndicates if weather should be shown in the slideshowfalsex
WEATHER_LOCATIONName of a cityBerlin
WEATHER_LANGUAGEWeather language (ISO_639-1 two digit code⁠)en
WEATHER_UNITWeather units (metric or imperial)metric
HOME_ASSISTANT_BASE_URLHome assistant base url (e.g.: http://192.168.0.123:8123)
HOME_ASSISTANT_ENTITY_IDHome assistant entity id to load the weather from (e.g.: sensor.outside_temperature)
HOME_ASSISTANT_API_TOKENHome assistant api access token
SHOW_HIDE_BUTTONShow the hide button on the slideshowfalsex
RANDOM_SLIDESHOWShow only random images instead of images from this week in previous yearsfalsex
IGNORE_FOLDER_MARKER_FILESA list of file names which causes the folder in which the file is located to be ignored. (comma separated).ignore
IGNORE_FOLDER_REGEXA regular expression that causes the folder to be ignored if it matches
PRELOAD_IMAGESIndicates if images should be preloaded during the slideshowfalse

Some parameters, as marked in the table, can be overwritten as URL parameter e.g.: http://localhost:8080/?SLIDESHOW_INTERVAL=10&SHOW_HIDE_BUTTON=false⁠

⁠Ignoring folders

There are two ways to ignore folders:

  1. By ignore file: If a folder contains a file with the name specified in IGNORE_FOLDER_MARKER_FILES, the folder is ignored.
  2. By folder name: If a folder name matches the regular expression specified in IGNORE_FOLDER_REGEX, the folder is ignored.

If a folder is ignored, all its sub-elements (files and folders) are also ignored.

⁠Limitations

  • Due to this issue⁠ of the image crate, there is currently no HEIC image support.

⁠Visual Interaction

The slideshow can be controlled by clicking on invisible zones on the screen. These zones are divided into three areas:

  • Previous Image: Clicking on the left side of the screen will show the previous image.
  • Pause/Resume: Clicking in the middle of the screen will pause or resume the slideshow.
  • Next Image: Clicking on the right side of the screen will show the next image.

The slideshow will automatically continue after the REFRESH_INTERVAL has passed.

⁠Performance

⁠Example 1
  • Hardware: i3-12100T, 3xWD_BLACK SN750 (RAID-Z1), 32GB RAM
  • Photos: ~80k
  • Indexing: 6 seconds
  • Uncached slideshow change: < 1 second
⁠Example 2
  • Hardware: Raspberry Pi Model B, Class 10 SD Card, 1GHz (OC) 32-Bit arm/v6, 512MB RAM
  • Photos: ~6k
  • Indexing: 38 seconds
  • Uncached slideshow change: ~7 seconds
⁠Example 3
  • Hardware: LG G3 (Android Smartphone), Internal Storage, Snapdragon 801 4C 32-Bit arm/v7, 3GB RAM
  • Photos: ~8k
  • Indexing: 50 seconds
  • Uncached slideshow change: < 1 second

Indexing scales with storage performance

Slideshow change scales with CPU performance

⁠Resources

Tag summary

Content type

Image

Digest

sha256:779f1d7d1…

Size

10.1 MB

Last updated

8 days ago

docker pull rouhim/this-week-in-past