feat: view similar photos (#21108)

* Enable filteing by example

* Drop `@GenerateSql` for `getEmbedding`?

* Improve error message

* PR Feedback

* Sort en.json

* Add SQL

* Fix lint

* Drop test that is no longer valid

* Fix i18n file sorting

* Fix TS error

* Add a `requireAccess` before pulling the embedding

* Fix decorators

* Run `make open-api`

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Arthur Normand
2025-09-04 10:22:09 -04:00
committed by GitHub
parent bf6211776f
commit 37a79292c0
12 changed files with 105 additions and 29 deletions

View File

@@ -68,7 +68,7 @@
const assetInteraction = new AssetInteraction();
type SearchTerms = MetadataSearchDto & Pick<SmartSearchDto, 'query'>;
type SearchTerms = MetadataSearchDto & Pick<SmartSearchDto, 'query' | 'queryAssetId'>;
let searchQuery = $derived(page.url.searchParams.get(QueryParameter.QUERY));
let smartSearchEnabled = $derived($featureFlags.loaded && $featureFlags.smartSearch);
let terms = $derived(searchQuery ? JSON.parse(searchQuery) : {});
@@ -164,7 +164,7 @@
try {
const { albums, assets } =
'query' in searchDto && smartSearchEnabled
('query' in searchDto || 'queryAssetId' in searchDto) && smartSearchEnabled
? await searchSmart({ smartSearchDto: searchDto })
: await searchAssets({ metadataSearchDto: searchDto });
@@ -210,6 +210,7 @@
tagIds: $t('tags'),
originalFileName: $t('file_name'),
description: $t('description'),
queryAssetId: $t('query_asset_id'),
};
return keyMap[key] || key;
}