Compare commits

...

3 Commits

Author SHA1 Message Date
timonrieger
75fbd1e8ea sync sql 2026-04-23 08:40:37 +02:00
timonrieger
7a0d8ecaad use new column entry instead 2026-04-23 08:39:58 +02:00
timonrieger
cdd47f3b10 fix(server): hide isFavorite from partner asset sync stream 2026-04-22 23:55:26 +02:00
3 changed files with 26 additions and 4 deletions

View File

@@ -395,6 +395,26 @@ export const columns = {
'asset.height',
'asset.isEdited',
],
syncPartnerAsset: [
'asset.id',
'asset.ownerId',
'asset.originalFileName',
'asset.thumbhash',
'asset.checksum',
'asset.fileCreatedAt',
'asset.fileModifiedAt',
'asset.localDateTime',
'asset.type',
'asset.deletedAt',
'asset.visibility',
'asset.duration',
'asset.livePhotoVideoId',
'asset.stackId',
'asset.libraryId',
'asset.width',
'asset.height',
'asset.isEdited',
],
syncAlbumUser: ['album_user.albumId as albumId', 'album_user.userId as userId', 'album_user.role'],
syncStack: ['stack.id', 'stack.createdAt', 'stack.updatedAt', 'stack.primaryAssetId', 'stack.ownerId'],
syncUser: ['id', 'name', 'email', 'avatarColor', 'deletedAt', 'updateId', 'profileImagePath', 'profileChangedAt'],

View File

@@ -739,7 +739,6 @@ select
"asset"."localDateTime",
"asset"."type",
"asset"."deletedAt",
"asset"."isFavorite",
"asset"."visibility",
"asset"."duration",
"asset"."livePhotoVideoId",
@@ -748,6 +747,7 @@ select
"asset"."width",
"asset"."height",
"asset"."isEdited",
false as "isFavorite",
"asset"."updateId"
from
"asset" as "asset"
@@ -791,7 +791,6 @@ select
"asset"."localDateTime",
"asset"."type",
"asset"."deletedAt",
"asset"."isFavorite",
"asset"."visibility",
"asset"."duration",
"asset"."livePhotoVideoId",
@@ -800,6 +799,7 @@ select
"asset"."width",
"asset"."height",
"asset"."isEdited",
false as "isFavorite",
"asset"."updateId"
from
"asset" as "asset"

View File

@@ -595,7 +595,8 @@ class PartnerAssetsSync extends BaseSync {
@GenerateSql({ params: [dummyBackfillOptions, DummyValue.UUID], stream: true })
getBackfill(options: SyncBackfillOptions, partnerId: string) {
return this.backfillQuery('asset', options)
.select(columns.syncAsset)
.select(columns.syncPartnerAsset)
.select(sql<boolean>`false`.as('isFavorite'))
.select('asset.updateId')
.where('ownerId', '=', partnerId)
.stream();
@@ -614,7 +615,8 @@ class PartnerAssetsSync extends BaseSync {
@GenerateSql({ params: [dummyQueryOptions], stream: true })
getUpserts(options: SyncQueryOptions) {
return this.upsertQuery('asset', options)
.select(columns.syncAsset)
.select(columns.syncPartnerAsset)
.select(sql<boolean>`false`.as('isFavorite'))
.select('asset.updateId')
.where('ownerId', 'in', (eb) =>
eb.selectFrom('partner').select(['sharedById']).where('sharedWithId', '=', options.userId),