1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

feat: update Immich integration migrations and enhance localization strings for user feedback

This commit is contained in:
Sean Morley 2025-01-02 18:34:13 -05:00
parent 386014db92
commit eea87e59a5
14 changed files with 275 additions and 99 deletions

View file

@ -1,7 +1,7 @@
# Generated by Django 5.0.8 on 2024-12-31 15:02 # Generated by Django 5.0.8 on 2025-01-02 23:16
import uuid
import django.db.models.deletion import django.db.models.deletion
import uuid
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
@ -18,11 +18,10 @@ class Migration(migrations.Migration):
migrations.CreateModel( migrations.CreateModel(
name='ImmichIntegration', name='ImmichIntegration',
fields=[ fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('server_url', models.CharField(max_length=255)), ('server_url', models.CharField(max_length=255)),
('api_key', models.CharField(max_length=255)), ('api_key', models.CharField(max_length=255)),
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
], ],
), ),
] ]

View file

@ -1,21 +0,0 @@
# Generated by Django 5.0.8 on 2024-12-31 18:29
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('integrations', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AlterField(
model_name='immichintegration',
name='user',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]

View file

@ -1,21 +0,0 @@
# Generated by Django 5.0.8 on 2025-01-02 17:50
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('integrations', '0002_alter_immichintegration_user'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.AlterField(
model_name='immichintegration',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]

View file

@ -13,6 +13,7 @@
$: { $: {
if (currentAlbum) { if (currentAlbum) {
immichImages = [];
fetchAlbumAssets(currentAlbum); fetchAlbumAssets(currentAlbum);
} else { } else {
immichImages = []; immichImages = [];
@ -104,29 +105,44 @@
{$t('immich.immich')} {$t('immich.immich')}
<img src={ImmichLogo} alt="Immich Logo" class="h-6 w-6 inline-block -mt-1" /> <img src={ImmichLogo} alt="Immich Logo" class="h-6 w-6 inline-block -mt-1" />
</label> </label>
<div> <div class="mt-4">
<label> <div class="join">
<input type="radio" bind:group={searchOrSelect} value="search" /> Search
</label>
<label>
<input type="radio" bind:group={searchOrSelect} value="select" /> Select Album
</label>
{#if searchOrSelect === 'search'}
<input <input
type="text" on:click={() => (currentAlbum = '')}
placeholder="Type here" type="radio"
bind:value={immichSearchValue} class="join-item btn"
class="input input-bordered w-full max-w-xs" bind:group={searchOrSelect}
value="search"
aria-label="Search"
/> />
<button on:click={searchImmich} class="btn btn-neutral mt-2">Search</button> <input
{:else} type="radio"
<select class="select select-bordered w-full max-w-xs" bind:value={currentAlbum}> class="join-item btn"
<option value="" disabled selected>Select an Album</option> bind:group={searchOrSelect}
{#each albums as album} value="select"
<option value={album.id}>{album.albumName}</option> aria-label="Select Album"
{/each} />
</select> </div>
{/if} <div>
{#if searchOrSelect === 'search'}
<form on:submit|preventDefault={searchImmich}>
<input
type="text"
placeholder="Type here"
bind:value={immichSearchValue}
class="input input-bordered w-full max-w-xs"
/>
<button type="submit" class="btn btn-neutral mt-2">Search</button>
</form>
{:else}
<select class="select select-bordered w-full max-w-xs mt-2" bind:value={currentAlbum}>
<option value="" disabled selected>Select an Album</option>
{#each albums as album}
<option value={album.id}>{album.albumName}</option>
{/each}
</select>
{/if}
</div>
</div> </div>
<p class="text-red-500">{immichError}</p> <p class="text-red-500">{immichError}</p>

View file

@ -215,7 +215,8 @@
"start": "Start", "start": "Start",
"starting_airport": "Startflughafen", "starting_airport": "Startflughafen",
"to": "Zu", "to": "Zu",
"transportation_delete_confirm": "Sind Sie sicher, dass Sie diesen Transport löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden." "transportation_delete_confirm": "Sind Sie sicher, dass Sie diesen Transport löschen möchten? \nDiese Aktion kann nicht rückgängig gemacht werden.",
"show_map": "Karte anzeigen"
}, },
"home": { "home": {
"desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit", "desc_1": "Entdecken, planen und erkunden Sie mit Leichtigkeit",
@ -500,5 +501,28 @@
"total_adventures": "Totale Abenteuer", "total_adventures": "Totale Abenteuer",
"total_visited_regions": "Insgesamt besuchte Regionen", "total_visited_regions": "Insgesamt besuchte Regionen",
"welcome_back": "Willkommen zurück" "welcome_back": "Willkommen zurück"
},
"immich": {
"api_key": "Immich-API-Schlüssel",
"api_note": "Hinweis: Dies muss die URL zum Immich-API-Server sein, daher endet sie wahrscheinlich mit /api, es sei denn, Sie haben eine benutzerdefinierte Konfiguration.",
"disable": "Deaktivieren",
"enable_immich": "Immich aktivieren",
"imageid_required": "Bild-ID ist erforderlich",
"immich": "Immich",
"immich_desc": "Integrieren Sie Ihr Immich-Konto mit AdventureLog, damit Sie Ihre Fotobibliothek durchsuchen und Fotos für Ihre Abenteuer importieren können.",
"immich_disabled": "Immich-Integration erfolgreich deaktiviert!",
"immich_enabled": "Immich-Integration erfolgreich aktiviert!",
"immich_error": "Fehler beim Aktualisieren der Immich-Integration",
"immich_updated": "Immich-Einstellungen erfolgreich aktualisiert!",
"integration_enabled": "Integration aktiviert",
"integration_fetch_error": "Fehler beim Abrufen der Daten aus der Immich-Integration",
"integration_missing": "Im Backend fehlt die Immich-Integration",
"load_more": "Mehr laden",
"no_items_found": "Keine Artikel gefunden",
"query_required": "Abfrage ist erforderlich",
"server_down": "Der Immich-Server ist derzeit ausgefallen oder nicht erreichbar",
"server_url": "Immich-Server-URL",
"update_integration": "Update-Integration",
"immich_integration": "Immich-Integration"
} }
} }

View file

@ -510,6 +510,19 @@
"server_down": "The Immich server is currently down or unreachable", "server_down": "The Immich server is currently down or unreachable",
"no_items_found": "No items found", "no_items_found": "No items found",
"imageid_required": "Image ID is required", "imageid_required": "Image ID is required",
"load_more": "Load More" "load_more": "Load More",
"immich_updated": "Immich settings updated successfully!",
"immich_enabled": "Immich integration enabled successfully!",
"immich_error": "Error updating Immich integration",
"immich_disabled": "Immich integration disabled successfully!",
"immich_desc": "Integrate your Immich account with AdventureLog to allow you to search your photos library and import photos for your adventures.",
"integration_enabled": "Integration Enabled",
"disable": "Disable",
"server_url": "Immich Server URL",
"api_note": "Note: this must be the URL to the Immich API server so it likely ends with /api unless you have a custom config.",
"api_key": "Immich API Key",
"enable_immich": "Enable Immich",
"update_integration": "Update Integration",
"immich_integration": "Immich Integration"
} }
} }

View file

@ -262,7 +262,8 @@
"start": "Comenzar", "start": "Comenzar",
"starting_airport": "Aeropuerto de inicio", "starting_airport": "Aeropuerto de inicio",
"to": "A", "to": "A",
"transportation_delete_confirm": "¿Está seguro de que desea eliminar este transporte? \nEsta acción no se puede deshacer." "transportation_delete_confirm": "¿Está seguro de que desea eliminar este transporte? \nEsta acción no se puede deshacer.",
"show_map": "Mostrar mapa"
}, },
"worldtravel": { "worldtravel": {
"all": "Todo", "all": "Todo",
@ -500,5 +501,28 @@
"total_adventures": "Aventuras totales", "total_adventures": "Aventuras totales",
"total_visited_regions": "Total de regiones visitadas", "total_visited_regions": "Total de regiones visitadas",
"welcome_back": "Bienvenido de nuevo" "welcome_back": "Bienvenido de nuevo"
},
"immich": {
"api_key": "Clave API de Immich",
"api_note": "Nota: esta debe ser la URL del servidor API de Immich, por lo que probablemente termine con /api a menos que tenga una configuración personalizada.",
"disable": "Desactivar",
"enable_immich": "Habilitar Immich",
"imageid_required": "Se requiere identificación con imagen",
"immich": "immicha",
"immich_desc": "Integre su cuenta de Immich con AdventureLog para permitirle buscar en su biblioteca de fotos e importar fotos para sus aventuras.",
"immich_disabled": "¡La integración de Immich se deshabilitó exitosamente!",
"immich_enabled": "¡La integración de Immich se habilitó exitosamente!",
"immich_error": "Error al actualizar la integración de Immich",
"immich_updated": "¡La configuración de Immich se actualizó exitosamente!",
"integration_enabled": "Integración habilitada",
"integration_fetch_error": "Error al obtener datos de la integración de Immich",
"integration_missing": "Falta la integración de Immich en el backend",
"load_more": "Cargar más",
"no_items_found": "No se encontraron artículos",
"query_required": "Se requiere consulta",
"server_down": "El servidor Immich está actualmente inactivo o inaccesible",
"server_url": "URL del servidor Immich",
"update_integration": "Integración de actualización",
"immich_integration": "Integración Immich"
} }
} }

View file

@ -215,7 +215,8 @@
"start": "Commencer", "start": "Commencer",
"starting_airport": "Aéroport de départ", "starting_airport": "Aéroport de départ",
"to": "À", "to": "À",
"transportation_delete_confirm": "Etes-vous sûr de vouloir supprimer ce transport ? \nCette action ne peut pas être annulée." "transportation_delete_confirm": "Etes-vous sûr de vouloir supprimer ce transport ? \nCette action ne peut pas être annulée.",
"show_map": "Afficher la carte"
}, },
"home": { "home": {
"desc_1": "Découvrez, planifiez et explorez en toute simplicité", "desc_1": "Découvrez, planifiez et explorez en toute simplicité",
@ -500,5 +501,28 @@
"total_adventures": "Aventures totales", "total_adventures": "Aventures totales",
"total_visited_regions": "Total des régions visitées", "total_visited_regions": "Total des régions visitées",
"welcome_back": "Content de te revoir" "welcome_back": "Content de te revoir"
},
"immich": {
"api_key": "Clé API Immich",
"api_note": "Remarque : il doit s'agir de l'URL du serveur API Immich, elle se termine donc probablement par /api, sauf si vous disposez d'une configuration personnalisée.",
"disable": "Désactiver",
"enable_immich": "Activer Immich",
"imageid_required": "L'identifiant de l'image est requis",
"immich": "Immich",
"immich_desc": "Intégrez votre compte Immich à AdventureLog pour vous permettre de rechercher dans votre bibliothèque de photos et d'importer des photos pour vos aventures.",
"immich_disabled": "Intégration Immich désactivée avec succès !",
"immich_enabled": "Intégration Immich activée avec succès !",
"immich_error": "Erreur lors de la mise à jour de l'intégration Immich",
"immich_integration": "Intégration Immich",
"immich_updated": "Paramètres Immich mis à jour avec succès !",
"integration_enabled": "Intégration activée",
"integration_fetch_error": "Erreur lors de la récupération des données de l'intégration Immich",
"integration_missing": "L'intégration Immich est absente du backend",
"load_more": "Charger plus",
"no_items_found": "Aucun article trouvé",
"query_required": "La requête est obligatoire",
"server_down": "Le serveur Immich est actuellement en panne ou inaccessible",
"server_url": "URL du serveur Immich",
"update_integration": "Intégration des mises à jour"
} }
} }

View file

@ -215,7 +215,8 @@
"start": "Inizio", "start": "Inizio",
"starting_airport": "Inizio aeroporto", "starting_airport": "Inizio aeroporto",
"to": "A", "to": "A",
"transportation_delete_confirm": "Sei sicuro di voler eliminare questo trasporto? \nQuesta azione non può essere annullata." "transportation_delete_confirm": "Sei sicuro di voler eliminare questo trasporto? \nQuesta azione non può essere annullata.",
"show_map": "Mostra mappa"
}, },
"home": { "home": {
"desc_1": "Scopri, pianifica ed esplora con facilità", "desc_1": "Scopri, pianifica ed esplora con facilità",
@ -500,5 +501,28 @@
"total_adventures": "Avventure totali", "total_adventures": "Avventure totali",
"total_visited_regions": "Totale regioni visitate", "total_visited_regions": "Totale regioni visitate",
"welcome_back": "Bentornato" "welcome_back": "Bentornato"
},
"immich": {
"api_key": "Chiave API Immich",
"api_note": "Nota: questo deve essere l'URL del server API Immich, quindi probabilmente termina con /api a meno che tu non abbia una configurazione personalizzata.",
"disable": "Disabilita",
"enable_immich": "Abilita Immich",
"imageid_required": "L'ID immagine è obbligatorio",
"immich": "Immich",
"immich_desc": "Integra il tuo account Immich con AdventureLog per consentirti di cercare nella tua libreria di foto e importare foto per le tue avventure.",
"immich_disabled": "Integrazione Immich disabilitata con successo!",
"immich_enabled": "Integrazione Immich abilitata con successo!",
"immich_error": "Errore durante l'aggiornamento dell'integrazione Immich",
"immich_integration": "Integrazione di Immich",
"immich_updated": "Impostazioni Immich aggiornate con successo!",
"integration_enabled": "Integrazione abilitata",
"integration_fetch_error": "Errore durante il recupero dei dati dall'integrazione Immich",
"integration_missing": "L'integrazione Immich manca dal backend",
"load_more": "Carica altro",
"no_items_found": "Nessun articolo trovato",
"query_required": "La domanda è obbligatoria",
"server_down": "Il server Immich è attualmente inattivo o irraggiungibile",
"server_url": "URL del server Immich",
"update_integration": "Aggiorna integrazione"
} }
} }

View file

@ -215,7 +215,8 @@
"starting_airport": "Startende luchthaven", "starting_airport": "Startende luchthaven",
"to": "Naar", "to": "Naar",
"transportation_delete_confirm": "Weet u zeker dat u dit transport wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.", "transportation_delete_confirm": "Weet u zeker dat u dit transport wilt verwijderen? \nDeze actie kan niet ongedaan worden gemaakt.",
"ending_airport": "Einde luchthaven" "ending_airport": "Einde luchthaven",
"show_map": "Toon kaart"
}, },
"home": { "home": {
"desc_1": "Ontdek, plan en verken met gemak", "desc_1": "Ontdek, plan en verken met gemak",
@ -500,5 +501,28 @@
"total_adventures": "Totale avonturen", "total_adventures": "Totale avonturen",
"total_visited_regions": "Totaal bezochte regio's", "total_visited_regions": "Totaal bezochte regio's",
"welcome_back": "Welkom terug" "welcome_back": "Welkom terug"
},
"immich": {
"api_key": "Immich API-sleutel",
"api_note": "Let op: dit moet de URL naar de Immich API-server zijn, dus deze eindigt waarschijnlijk op /api, tenzij je een aangepaste configuratie hebt.",
"disable": "Uitzetten",
"enable_immich": "Schakel Immich in",
"imageid_required": "Afbeeldings-ID is vereist",
"immich": "Immich",
"immich_desc": "Integreer uw Immich-account met AdventureLog zodat u in uw fotobibliotheek kunt zoeken en foto's voor uw avonturen kunt importeren.",
"immich_disabled": "Immich-integratie succesvol uitgeschakeld!",
"immich_enabled": "Immich-integratie succesvol ingeschakeld!",
"immich_error": "Fout bij updaten van Immich-integratie",
"immich_integration": "Immich-integratie",
"immich_updated": "Immich-instellingen zijn succesvol bijgewerkt!",
"integration_enabled": "Integratie ingeschakeld",
"integration_fetch_error": "Fout bij het ophalen van gegevens uit de Immich-integratie",
"integration_missing": "De Immich-integratie ontbreekt in de backend",
"load_more": "Laad meer",
"no_items_found": "Geen artikelen gevonden",
"query_required": "Er is een zoekopdracht vereist",
"server_down": "De Immich-server is momenteel offline of onbereikbaar",
"server_url": "Immich-server-URL",
"update_integration": "Integratie bijwerken"
} }
} }

View file

@ -262,7 +262,8 @@
"start": "Start", "start": "Start",
"starting_airport": "Początkowe lotnisko", "starting_airport": "Początkowe lotnisko",
"to": "Do", "to": "Do",
"transportation_delete_confirm": "Czy na pewno chcesz usunąć ten transport? \nTej akcji nie można cofnąć." "transportation_delete_confirm": "Czy na pewno chcesz usunąć ten transport? \nTej akcji nie można cofnąć.",
"show_map": "Pokaż mapę"
}, },
"worldtravel": { "worldtravel": {
"country_list": "Lista krajów", "country_list": "Lista krajów",
@ -500,5 +501,28 @@
"total_adventures": "Totalne przygody", "total_adventures": "Totalne przygody",
"total_visited_regions": "Łączna liczba odwiedzonych regionów", "total_visited_regions": "Łączna liczba odwiedzonych regionów",
"welcome_back": "Witamy z powrotem" "welcome_back": "Witamy z powrotem"
},
"immich": {
"api_key": "Klucz API Immicha",
"api_note": "Uwaga: musi to być adres URL serwera API Immich, więc prawdopodobnie kończy się na /api, chyba że masz niestandardową konfigurację.",
"disable": "Wyłączyć",
"enable_immich": "Włącz Immicha",
"immich": "Immich",
"immich_enabled": "Integracja z Immich została pomyślnie włączona!",
"immich_error": "Błąd podczas aktualizacji integracji Immich",
"immich_integration": "Integracja Immicha",
"immich_updated": "Ustawienia Immich zostały pomyślnie zaktualizowane!",
"integration_enabled": "Integracja włączona",
"integration_fetch_error": "Błąd podczas pobierania danych z integracji Immich",
"integration_missing": "W backendie brakuje integracji z Immich",
"load_more": "Załaduj więcej",
"no_items_found": "Nie znaleziono żadnych elementów",
"query_required": "Zapytanie jest wymagane",
"server_down": "Serwer Immich jest obecnie wyłączony lub nieosiągalny",
"server_url": "Adres URL serwera Immich",
"update_integration": "Zaktualizuj integrację",
"imageid_required": "Wymagany jest identyfikator obrazu",
"immich_desc": "Zintegruj swoje konto Immich z AdventureLog, aby móc przeszukiwać bibliotekę zdjęć i importować zdjęcia do swoich przygód.",
"immich_disabled": "Integracja z Immich została pomyślnie wyłączona!"
} }
} }

View file

@ -1,5 +1,4 @@
{ {
"about": { "about": {
"about": "Om", "about": "Om",
"close": "Stäng", "close": "Stäng",
@ -216,7 +215,8 @@
"start": "Start", "start": "Start",
"starting_airport": "Startar flygplats", "starting_airport": "Startar flygplats",
"to": "Till", "to": "Till",
"transportation_delete_confirm": "Är du säker på att du vill ta bort denna transport? \nDenna åtgärd kan inte ångras." "transportation_delete_confirm": "Är du säker på att du vill ta bort denna transport? \nDenna åtgärd kan inte ångras.",
"show_map": "Visa karta"
}, },
"home": { "home": {
"desc_1": "Upptäck, planera och utforska med lätthet", "desc_1": "Upptäck, planera och utforska med lätthet",
@ -501,5 +501,28 @@
"total_adventures": "Totala äventyr", "total_adventures": "Totala äventyr",
"total_visited_regions": "Totalt antal besökta regioner", "total_visited_regions": "Totalt antal besökta regioner",
"welcome_back": "Välkommen tillbaka" "welcome_back": "Välkommen tillbaka"
},
"immich": {
"api_key": "Immich API-nyckel",
"api_note": "Obs: detta måste vara URL:en till Immich API-servern så den slutar troligen med /api om du inte har en anpassad konfiguration.",
"disable": "Inaktivera",
"enable_immich": "Aktivera Immich",
"imageid_required": "Bild-ID krävs",
"immich": "Immich",
"immich_desc": "Integrera ditt Immich-konto med AdventureLog så att du kan söka i ditt fotobibliotek och importera bilder för dina äventyr.",
"immich_disabled": "Immich-integrationen inaktiverades framgångsrikt!",
"immich_enabled": "Immich-integrationen har aktiverats framgångsrikt!",
"immich_error": "Fel vid uppdatering av Immich-integration",
"immich_integration": "Immich Integration",
"immich_updated": "Immich-inställningarna har uppdaterats framgångsrikt!",
"integration_enabled": "Integration aktiverad",
"integration_fetch_error": "Fel vid hämtning av data från Immich-integrationen",
"integration_missing": "Immich-integrationen saknas i backend",
"load_more": "Ladda mer",
"no_items_found": "Inga föremål hittades",
"query_required": "Fråga krävs",
"server_down": "Immich-servern är för närvarande nere eller kan inte nås",
"server_url": "Immich Server URL",
"update_integration": "Uppdatera integration"
} }
} }

View file

@ -215,7 +215,8 @@
"start": "开始", "start": "开始",
"starting_airport": "出发机场", "starting_airport": "出发机场",
"to": "到", "to": "到",
"transportation_delete_confirm": "您确定要删除此交通工具吗?\n此操作无法撤消。" "transportation_delete_confirm": "您确定要删除此交通工具吗?\n此操作无法撤消。",
"show_map": "显示地图"
}, },
"home": { "home": {
"desc_1": "轻松发现、规划和探索", "desc_1": "轻松发现、规划和探索",
@ -500,5 +501,28 @@
"total_adventures": "全面冒险", "total_adventures": "全面冒险",
"total_visited_regions": "总访问地区", "total_visited_regions": "总访问地区",
"welcome_back": "欢迎回来" "welcome_back": "欢迎回来"
},
"immich": {
"api_key": "伊米奇 API 密钥",
"api_note": "注意:这必须是 Immich API 服务器的 URL因此它可能以 /api 结尾,除非您有自定义配置。",
"disable": "禁用",
"enable_immich": "启用伊米奇",
"imageid_required": "需要图像 ID",
"immich": "伊米奇",
"immich_desc": "将您的 Immich 帐户与 AdventureLog 集成,以便您搜索照片库并导入冒险照片。",
"immich_disabled": "Immich 集成成功禁用!",
"immich_enabled": "Immich 集成成功启用!",
"immich_error": "更新 Immich 集成时出错",
"immich_integration": "伊米奇整合",
"immich_updated": "Immich 设置更新成功!",
"integration_enabled": "启用集成",
"integration_fetch_error": "从 Immich 集成获取数据时出错",
"integration_missing": "后端缺少 Immich 集成",
"load_more": "加载更多",
"no_items_found": "没有找到物品",
"query_required": "需要查询",
"server_down": "Immich 服务器当前已关闭或无法访问",
"server_url": "伊米奇服务器网址",
"update_integration": "更新集成"
} }
} }

View file

@ -152,10 +152,10 @@
}); });
let data = await res.json(); let data = await res.json();
if (res.ok) { if (res.ok) {
addToast('success', $t('settings.immich_enabled')); addToast('success', $t('immich.immich_enabled'));
immichIntegration = data; immichIntegration = data;
} else { } else {
addToast('error', $t('settings.immich_error')); addToast('error', $t('immich.immich_error'));
} }
} else { } else {
let res = await fetch(`/api/integrations/immich/${immichIntegration.id}/`, { let res = await fetch(`/api/integrations/immich/${immichIntegration.id}/`, {
@ -167,10 +167,10 @@
}); });
let data = await res.json(); let data = await res.json();
if (res.ok) { if (res.ok) {
addToast('success', $t('settings.immich_updated')); addToast('success', $t('immich.immich_updated'));
immichIntegration = data; immichIntegration = data;
} else { } else {
addToast('error', $t('settings.immich_error')); addToast('error', $t('immich.immich_error'));
} }
} }
} }
@ -181,10 +181,10 @@
method: 'DELETE' method: 'DELETE'
}); });
if (res.ok) { if (res.ok) {
addToast('success', $t('settings.immich_disabled')); addToast('success', $t('immich.immich_disabled'));
immichIntegration = null; immichIntegration = null;
} else { } else {
addToast('error', $t('settings.immich_error')); addToast('error', $t('immich.immich_error'));
} }
} }
} }
@ -427,20 +427,16 @@
<!-- Immich Integration Section --> <!-- Immich Integration Section -->
<section class="space-y-8"> <section class="space-y-8">
<h2 class="text-2xl font-semibold text-center mt-8"> <h2 class="text-2xl font-semibold text-center mt-8">
Immich Integration <img {$t('immich.immich_integration')}
src={ImmichLogo} <img src={ImmichLogo} alt="Immich" class="inline-block w-8 h-8 -mt-1" />
alt="Immich Logo"
class="inline-block w-8 h-8 -mt-1"
/>
</h2> </h2>
<div class="bg-neutral p-6 rounded-lg shadow-md"> <div class="bg-neutral p-6 rounded-lg shadow-md">
<p class="text-center text-neutral-content"> <p class="text-center text-neutral-content">
Integrate your Immich account with AdventureLog to allow you to search your photos library {$t('immich.immich_desc')}
and import photos for your adventures.
</p> </p>
{#if immichIntegration} {#if immichIntegration}
<div class="flex flex-col items-center justify-center mt-1 space-y-2"> <div class="flex flex-col items-center justify-center mt-1 space-y-2">
<div class="badge badge-success">Integration Enabled</div> <div class="badge badge-success">{$t('immich.integration_enabled')}</div>
<div class="flex space-x-2"> <div class="flex space-x-2">
<button <button
class="btn btn-warning" class="btn btn-warning"
@ -448,7 +444,9 @@
if (immichIntegration) newImmichIntegration = immichIntegration; if (immichIntegration) newImmichIntegration = immichIntegration;
}}>Edit</button }}>Edit</button
> >
<button class="btn btn-error" on:click={disableImmichIntegration}>Disable</button> <button class="btn btn-error" on:click={disableImmichIntegration}
>{$t('immich.disable')}</button
>
</div> </div>
</div> </div>
{/if} {/if}
@ -456,38 +454,39 @@
<div class="mt-4"> <div class="mt-4">
<div> <div>
<label for="immich_url" class="text-sm font-medium text-neutral-content" <label for="immich_url" class="text-sm font-medium text-neutral-content"
>Immich Server URL</label >{$t('immich.server_url')}</label
> >
<input <input
type="url" type="url"
id="immich_url" id="immich_url"
name="immich_url" name="immich_url"
bind:value={newImmichIntegration.server_url} bind:value={newImmichIntegration.server_url}
placeholder="Immich Server URL (e.g. https://immich.example.com/api)" placeholder="{$t('immich.server_url')} (e.g. https://immich.example.com/api)"
class="block w-full mt-1 input input-bordered input-primary" class="block w-full mt-1 input input-bordered input-primary"
/> />
{#if newImmichIntegration.server_url && !newImmichIntegration.server_url.endsWith('api')} {#if newImmichIntegration.server_url && !newImmichIntegration.server_url.endsWith('api')}
<p class="text-s text-warning mt-2"> <p class="text-s text-warning mt-2">
Note: this must be the URL to the Immich API server so it likely ends with /api {$t('immich.api_note')}
unless you have a custom config.
</p> </p>
{/if} {/if}
</div> </div>
<div class="mt-4"> <div class="mt-4">
<label for="immich_api_key" class="text-sm font-medium text-neutral-content" <label for="immich_api_key" class="text-sm font-medium text-neutral-content"
>Immich API Key</label >{$t('immich.api_key')}</label
> >
<input <input
type="text" type="text"
id="immich_api_key" id="immich_api_key"
name="immich_api_key" name="immich_api_key"
bind:value={newImmichIntegration.api_key} bind:value={newImmichIntegration.api_key}
placeholder="Immich API Key" placeholder={$t('immich.api_key')}
class="block w-full mt-1 input input-bordered input-primary" class="block w-full mt-1 input input-bordered input-primary"
/> />
</div> </div>
<button on:click={enableImmichIntegration} class="w-full mt-4 btn btn-primary py-2" <button on:click={enableImmichIntegration} class="w-full mt-4 btn btn-primary py-2"
>{!immichIntegration?.id ? 'Enable Immich' : 'Edit Integration'}</button >{!immichIntegration?.id
? $t('immich.enable_immich')
: $t('immich.update_integration')}</button
> >
</div> </div>
{/if} {/if}