refactor(memories): generalize photo providers and decouple from immich

This commit is contained in:
Marek Maslowski
2026-04-03 02:54:35 +02:00
parent f4d0ccb454
commit cf968969d0
13 changed files with 901 additions and 155 deletions
+16
View File
@@ -4,9 +4,22 @@ import { addonsApi } from '../api/client'
interface Addon {
id: string
name: string
description?: string
type: string
icon: string
enabled: boolean
config?: Record<string, unknown>
fields?: Array<{
key: string
label: string
input_type: string
placeholder?: string | null
required: boolean
secret: boolean
settings_key?: string | null
payload_key?: string | null
sort_order: number
}>
}
interface AddonState {
@@ -30,6 +43,9 @@ export const useAddonStore = create<AddonState>((set, get) => ({
},
isEnabled: (id: string) => {
if (id === 'memories') {
return get().addons.some(a => a.type === 'photo_provider' && a.enabled)
}
return get().addons.some(a => a.id === id && a.enabled)
},
}))