Compare commits

...

2 Commits

Author SHA1 Message Date
Alex The Bot
da1710bcd2 Version v1.59.1 2023-05-30 17:56:47 +00:00
Jason Rasmussen
2dfd56b49b fix: reload assets from typesense results (#2615)
* fix: reload assets from typesense results

* chore: coverage
2023-05-30 12:55:06 -05:00
14 changed files with 47 additions and 18 deletions

View File

@@ -36,7 +36,7 @@ platform :android do
build_type: 'Release',
properties: {
"android.injected.version.code" => 82,
"android.injected.version.name" => "1.59.0",
"android.injected.version.name" => "1.59.1",
}
)
upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab')

View File

@@ -19,7 +19,7 @@ platform :ios do
desc "iOS Beta"
lane :beta do
increment_version_number(
version_number: "1.59.0"
version_number: "1.59.1"
)
increment_build_number(
build_number: latest_testflight_build_number + 1,

View File

@@ -3,7 +3,7 @@ Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.59.0
- API version: 1.59.1
- Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements

View File

@@ -2,7 +2,7 @@ name: immich_mobile
description: Immich - selfhosted backup media file on mobile phone
publish_to: "none"
version: 1.59.0+82
version: 1.59.1+82
isar_version: &isar_version 3.1.0+1
environment:

View File

@@ -4148,7 +4148,7 @@
"info": {
"title": "Immich",
"description": "Immich API",
"version": "1.59.0",
"version": "1.59.1",
"contact": {}
},
"tags": [],

View File

@@ -106,9 +106,22 @@ export class SearchService {
async getExploreData(authUser: AuthUserDto): Promise<SearchExploreItem<AssetResponseDto>[]> {
this.assertEnabled();
const results = await this.searchRepository.explore(authUser.id);
const lookup = await this.getLookupMap(
results.reduce(
(ids: string[], result: SearchExploreItem<AssetEntity>) => [
...ids,
...result.items.map((item) => item.data.id),
],
[],
),
);
return results.map(({ fieldName, items }) => ({
fieldName,
items: items.map(({ value, data }) => ({ value, data: mapAsset(data) })),
items: items
.map(({ value, data }) => ({ value, data: lookup[data.id] }))
.filter(({ data }) => !!data)
.map(({ value, data }) => ({ value, data: mapAsset(data) })),
}));
}
@@ -132,10 +145,17 @@ export class SearchService {
}
const albums = await this.searchRepository.searchAlbums(query, filters);
const lookup = await this.getLookupMap(assets.items.map((asset) => asset.id));
return {
albums: { ...albums, items: albums.items.map(mapAlbum) },
assets: { ...assets, items: assets.items.map(mapAsset) },
assets: {
...assets,
items: assets.items
.map((item) => lookup[item.id])
.filter((item) => !!item)
.map(mapAsset),
},
};
}
@@ -358,4 +378,13 @@ export class SearchService {
const [assetId, personId] = key.split('|');
return { assetId, personId };
}
private async getLookupMap(assetIds: string[]) {
const assets = await this.assetRepository.getByIds(assetIds);
const lookup: Record<string, AssetEntity> = {};
for (const asset of assets) {
lookup[asset.id] = asset;
}
return lookup;
}
}

View File

@@ -2,7 +2,7 @@ import { IAssetRepository } from '../src';
export const newAssetRepositoryMock = (): jest.Mocked<IAssetRepository> => {
return {
getByIds: jest.fn(),
getByIds: jest.fn().mockResolvedValue([]),
getWithout: jest.fn(),
getWith: jest.fn(),
getFirstAssetForAlbumId: jest.fn(),

View File

@@ -1,12 +1,12 @@
{
"name": "immich",
"version": "1.59.0",
"version": "1.59.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "immich",
"version": "1.59.0",
"version": "1.59.1",
"license": "UNLICENSED",
"dependencies": {
"@babel/runtime": "^7.20.13",

View File

@@ -1,6 +1,6 @@
{
"name": "immich",
"version": "1.59.0",
"version": "1.59.1",
"description": "",
"author": "",
"private": true,
@@ -140,8 +140,8 @@
"coverageThreshold": {
"./libs/domain/": {
"branches": 80,
"functions": 87,
"lines": 93.7,
"functions": 85,
"lines": 93,
"statements": 93
}
},

View File

@@ -4,7 +4,7 @@
* Immich
* Immich API
*
* The version of the OpenAPI document: 1.59.0
* The version of the OpenAPI document: 1.59.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -4,7 +4,7 @@
* Immich
* Immich API
*
* The version of the OpenAPI document: 1.59.0
* The version of the OpenAPI document: 1.59.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -4,7 +4,7 @@
* Immich
* Immich API
*
* The version of the OpenAPI document: 1.59.0
* The version of the OpenAPI document: 1.59.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -4,7 +4,7 @@
* Immich
* Immich API
*
* The version of the OpenAPI document: 1.59.0
* The version of the OpenAPI document: 1.59.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

View File

@@ -4,7 +4,7 @@
* Immich
* Immich API
*
* The version of the OpenAPI document: 1.59.0
* The version of the OpenAPI document: 1.59.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).