Add an active link to the photo in Immich

This commit is contained in:
Eugene Burmakin 2024-11-26 18:03:46 +01:00
parent 3c6f2e5ce3
commit c5044781b9
3 changed files with 26 additions and 4 deletions

View file

@ -1 +1 @@
0.16.9
0.17.0

View file

@ -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

View file

@ -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 = `
<div class="max-w-xs">
<img src="${thumbnailUrl}"
class="w-8 h-8 mb-2 rounded"
alt="${photo.originalFileName}">
<a href="${immich_photo_link}" target="_blank">
<img src="${thumbnailUrl}"
class="w-8 h-8 mb-2 rounded"
alt="${photo.originalFileName}">
</a>
<h3 class="font-bold">${photo.originalFileName}</h3>
<p>Taken: ${new Date(photo.localDateTime).toLocaleString()}</p>
<p>Location: ${photo.exifInfo.city}, ${photo.exifInfo.state}, ${photo.exifInfo.country}</p>