feat: enable downloads from search results
This commit is contained in:
1 parent
cccb214229
commit
9aa79cbce9
3 files changed
+53
-3
No files matched your search
@@ -107,13 +107,22 @@ async function searchAlbum(
|
||||
size: number,
|
||||
): Promise<ImmichSearchPage> {
|
||||
try {
|
||||
return await immich.searchPhotos({
|
||||
const searchPage = await immich.searchPhotos({
|
||||
albumIds,
|
||||
...(description === undefined ? {} : { description }),
|
||||
type: "IMAGE",
|
||||
page,
|
||||
size,
|
||||
});
|
||||
const queriedAlbumId = albumIds[0];
|
||||
return {
|
||||
...searchPage,
|
||||
items: queriedAlbumId
|
||||
? searchPage.items.map((asset) => asset.albums.some(({ id }) => id === queriedAlbumId)
|
||||
? asset
|
||||
: { ...asset, albums: [{ id: queriedAlbumId }, ...asset.albums] })
|
||||
: searchPage.items,
|
||||
};
|
||||
} catch {
|
||||
throw new AlbumCatalogError("IMMICH_UNAVAILABLE");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user