mirror of
https://github.com/immich-app/immich.git
synced 2026-02-11 03:17:59 +03:00
chore: make sql
This commit is contained in:
@@ -279,6 +279,15 @@ where
|
||||
"asset_faces"."personId" = $1
|
||||
and "asset_faces"."deletedAt" is null
|
||||
|
||||
-- PersonRepository.getAssetPersonByFaceId
|
||||
select
|
||||
"asset_faces"."assetId",
|
||||
"asset_faces"."personId"
|
||||
from
|
||||
"asset_faces"
|
||||
where
|
||||
"asset_faces"."id" = $1
|
||||
|
||||
-- PersonRepository.getLatestFaceDate
|
||||
select
|
||||
max("asset_job_status"."facesRecognizedAt")::text as "latestDate"
|
||||
|
||||
@@ -11,7 +11,6 @@ export class TrashRepository {
|
||||
return this.db.selectFrom('assets').select(['id']).where('status', '=', AssetStatus.DELETED).stream();
|
||||
}
|
||||
|
||||
@GenerateSql({ params: [DummyValue.UUID] })
|
||||
getTrashedIds(userId: string): AsyncIterableIterator<{ id: string }> {
|
||||
return this.db
|
||||
.selectFrom('assets')
|
||||
|
||||
@@ -80,7 +80,11 @@ describe(ActivityService.name, () => {
|
||||
|
||||
mocks.access.activity.checkCreateAccess.mockResolvedValue(new Set([albumId]));
|
||||
mocks.activity.create.mockResolvedValue(activity);
|
||||
mocks.album.getById.mockResolvedValue({ ...albumStub.empty, owner: factory.user({ id: userId }), albumUsers: [] });
|
||||
mocks.album.getById.mockResolvedValue({
|
||||
...albumStub.empty,
|
||||
owner: factory.user({ id: userId }),
|
||||
albumUsers: [],
|
||||
});
|
||||
|
||||
await sut.create(factory.auth({ user: { id: userId } }), {
|
||||
albumId,
|
||||
@@ -117,7 +121,11 @@ describe(ActivityService.name, () => {
|
||||
mocks.access.activity.checkCreateAccess.mockResolvedValue(new Set([albumId]));
|
||||
mocks.activity.create.mockResolvedValue(activity);
|
||||
mocks.activity.search.mockResolvedValue([]);
|
||||
mocks.album.getById.mockResolvedValue({ ...albumStub.empty, owner: factory.user({ id: userId }), albumUsers: [] });
|
||||
mocks.album.getById.mockResolvedValue({
|
||||
...albumStub.empty,
|
||||
owner: factory.user({ id: userId }),
|
||||
albumUsers: [],
|
||||
});
|
||||
|
||||
await sut.create(factory.auth({ user: { id: userId } }), { albumId, assetId, type: ReactionType.LIKE });
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ class ActivityManager {
|
||||
this.#subscribe = createSubscriber((update) => {
|
||||
const unsubscribe = websocketEvents.on('on_activity_change', ({ albumId, assetId }) => {
|
||||
if (this.#albumId === albumId || this.#assetId === assetId) {
|
||||
this.#invalidateCache(this.#albumId, this.#assetId);
|
||||
handlePromiseError(this.refreshActivities(this.#albumId!, this.#assetId));
|
||||
this.#invalidateCache(albumId, this.#assetId);
|
||||
handlePromiseError(this.refreshActivities(albumId, this.#assetId));
|
||||
update();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user