Use nulls, make-sql

This commit is contained in:
Min Idzelis
2025-05-03 02:06:34 +00:00
parent 0ed2a2fd2e
commit aea2c9506d
19 changed files with 186 additions and 205 deletions

View File

@@ -409,10 +409,6 @@
}
};
const assetOnFocusHandler = (asset: TimelineAsset) => {
assetInteraction.focussedAssetId = asset.id;
};
let isTrashEnabled = $derived($featureFlags.loaded && $featureFlags.trash);
let idsSelectedAssets = $derived(assetInteraction.selectedAssets.map(({ id }) => id));
@@ -481,7 +477,6 @@
}}
onSelect={() => handleSelectAssets(toTimelineAsset(asset))}
onMouseEvent={() => assetMouseEventHandler(toTimelineAsset(asset))}
handleFocus={() => assetOnFocusHandler(toTimelineAsset(asset))}
{showArchiveIcon}
asset={toTimelineAsset(asset)}
selected={assetInteraction.hasSelectedAsset(asset.id)}

View File

@@ -419,10 +419,6 @@ export class AssetBucket {
};
}
#decodeString(stringOrNumber: string | number) {
return typeof stringOrNumber === 'number' ? null : (stringOrNumber as string);
}
// note - if the assets are not part of this bucket, they will not be added
addAssets(bucketResponse: TimeBucketResponseDto) {
const addContext = new AddContext();
@@ -432,20 +428,20 @@ export class AssetBucket {
...bucketResponse.bucketAssets.description[i],
people: [],
},
duration: this.#decodeString(bucketResponse.bucketAssets.duration[i]),
duration: bucketResponse.bucketAssets.duration[i],
id: bucketResponse.bucketAssets.id[i],
isArchived: !!bucketResponse.bucketAssets.isArchived[i],
isFavorite: !!bucketResponse.bucketAssets.isFavorite[i],
isImage: !!bucketResponse.bucketAssets.isImage[i],
isTrashed: !!bucketResponse.bucketAssets.isTrashed[i],
isVideo: !!bucketResponse.bucketAssets.isVideo[i],
livePhotoVideoId: this.#decodeString(bucketResponse.bucketAssets.livePhotoVideoId[i]),
livePhotoVideoId: bucketResponse.bucketAssets.livePhotoVideoId[i],
localDateTime: bucketResponse.bucketAssets.localDateTime[i],
ownerId: bucketResponse.bucketAssets.ownerId[i],
projectionType: this.#decodeString(bucketResponse.bucketAssets.projectionType[i]),
projectionType: bucketResponse.bucketAssets.projectionType[i],
ratio: bucketResponse.bucketAssets.ratio[i],
stack: bucketResponse.bucketAssets.stack[i],
thumbhash: this.#decodeString(bucketResponse.bucketAssets.thumbhash[i]),
thumbhash: bucketResponse.bucketAssets.thumbhash[i],
};
this.addTimelineAsset(timelineAsset, addContext);
}