mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-01 19:25:17 +02:00
immich: Automatically select the date of the last visit for the photos
This commit is contained in:
parent
aaacacbd60
commit
08bfeac837
2 changed files with 14 additions and 6 deletions
|
@ -1257,6 +1257,7 @@ it would also work to just use on:click on the MapLibre component itself. -->
|
||||||
|
|
||||||
{#if immichIntegration}
|
{#if immichIntegration}
|
||||||
<ImmichSelect
|
<ImmichSelect
|
||||||
|
adventure={adventure}
|
||||||
on:fetchImage={(e) => {
|
on:fetchImage={(e) => {
|
||||||
url = e.detail;
|
url = e.detail;
|
||||||
fetchImage();
|
fetchImage();
|
||||||
|
|
|
@ -1,18 +1,28 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { t } from 'svelte-i18n';
|
||||||
|
import ImmichLogo from '$lib/assets/immich.svg';
|
||||||
|
import type { Adventure, ImmichAlbum } from '$lib/types';
|
||||||
|
import { debounce } from '$lib';
|
||||||
|
|
||||||
let immichSearchValue: string = '';
|
let immichSearchValue: string = '';
|
||||||
let searchCategory: 'search' | 'date' | 'album' = 'search';
|
let searchCategory: 'search' | 'date' | 'album' = 'search';
|
||||||
let immichError: string = '';
|
let immichError: string = '';
|
||||||
let immichNextURL: string = '';
|
let immichNextURL: string = '';
|
||||||
let loading = false; // TODO: Implement loading indicator
|
let loading = false; // TODO: Implement loading indicator
|
||||||
|
|
||||||
|
export let adventure: Adventure | null = null;
|
||||||
|
|
||||||
// TODO: Show date of pictures somewhere?
|
// TODO: Show date of pictures somewhere?
|
||||||
import { createEventDispatcher, onMount } from 'svelte';
|
import { createEventDispatcher, onMount } from 'svelte';
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
let albums: ImmichAlbum[] = [];
|
let albums: ImmichAlbum[] = [];
|
||||||
let currentAlbum: string = '';
|
let currentAlbum: string = '';
|
||||||
let selectedDate: string = new Date().toISOString().split('T')[0]; // TODO: Auto select from adventure.
|
|
||||||
|
let selectedDate: string = (adventure as Adventure | null)?.visits.map(v => new Date(v.end_date || v.start_date)).sort((a,b) => +b - +a)[0]?.toISOString().split('T')[0] || '';
|
||||||
|
if (!selectedDate) {
|
||||||
|
selectedDate = new Date().toISOString().split('T')[0];
|
||||||
|
}
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if (currentAlbum) {
|
if (currentAlbum) {
|
||||||
|
@ -75,10 +85,7 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
let immichImages: any[] = [];
|
let immichImages: any[] = [];
|
||||||
import { t } from 'svelte-i18n';
|
|
||||||
import ImmichLogo from '$lib/assets/immich.svg';
|
|
||||||
import type { ImmichAlbum } from '$lib/types';
|
|
||||||
import { debounce } from '$lib';
|
|
||||||
|
|
||||||
function buildQueryParams() {
|
function buildQueryParams() {
|
||||||
let params = new URLSearchParams();
|
let params = new URLSearchParams();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue