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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user