From c5044781b9143e26741fe28fa4709ee8d5602a01 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 26 Nov 2024 18:03:46 +0100 Subject: [PATCH] Add an active link to the photo in Immich --- .app_version | 2 +- CHANGELOG.md | 8 ++++++++ app/javascript/controllers/maps_controller.js | 20 ++++++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.app_version b/.app_version index ce62dc55..c5523bd0 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.16.9 +0.17.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2491962e..e040261f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +# 0.17.0 - 2024-11-26 + +### Added + +- If you have provided your Immich instance URL and API key, the map will now show photos from your Immich instance when Photos layer is enabled. +- `GET /api/v1/photos` endpoint added to get photos from Immich. +- `GET /api/v1/photos/:id/thumbnail.jpg` endpoint added to get photo thumbnail from Immich. + # 0.16.9 - 2024-11-24 ### Changed diff --git a/app/javascript/controllers/maps_controller.js b/app/javascript/controllers/maps_controller.js index 70d42258..1f21e465 100644 --- a/app/javascript/controllers/maps_controller.js +++ b/app/javascript/controllers/maps_controller.js @@ -880,11 +880,25 @@ export default class extends Controller { { icon } ); + const startOfDay = new Date(photo.localDateTime); + startOfDay.setHours(0, 0, 0, 0); + + const endOfDay = new Date(photo.localDateTime); + endOfDay.setHours(23, 59, 59, 999); + + const queryParams = { + takenAfter: startOfDay.toISOString(), + takenBefore: endOfDay.toISOString() + }; + const encodedQuery = encodeURIComponent(JSON.stringify(queryParams)); + const immich_photo_link = `${this.userSettings.immich_url}/search?query=${encodedQuery}`; const popupContent = `
- ${photo.originalFileName} + + ${photo.originalFileName} +

${photo.originalFileName}

Taken: ${new Date(photo.localDateTime).toLocaleString()}

Location: ${photo.exifInfo.city}, ${photo.exifInfo.state}, ${photo.exifInfo.country}