+8
__generated__/lexicons.ts
+8
__generated__/lexicons.ts
···
3783
3783
},
3784
3784
galleryState: {
3785
3785
type: 'object',
3786
+
required: ['item', 'itemCreatedAt', 'itemPosition'],
3786
3787
description:
3787
3788
"Metadata about the photo's relationship with the subject content. Only has meaningful content when photo is attached to a gallery.",
3788
3789
properties: {
3789
3790
item: {
3790
3791
type: 'string',
3791
3792
format: 'at-uri',
3793
+
},
3794
+
itemCreatedAt: {
3795
+
type: 'string',
3796
+
format: 'datetime',
3797
+
},
3798
+
itemPosition: {
3799
+
type: 'integer',
3792
3800
},
3793
3801
},
3794
3802
},
+3
-3
src/lib/gallery.ts
+3
-3
src/lib/gallery.ts
···
25
25
import { photoToView } from "./photo.ts";
26
26
27
27
type PhotoWithMeta = WithBffMeta<Photo> & {
28
-
galleryItemUri?: string;
28
+
item?: WithBffMeta<GalleryItem>;
29
29
exif?: WithBffMeta<PhotoExif>;
30
30
};
31
31
···
90
90
// Attach the galleryItem uri as itemUri
91
91
galleryPhotosMap.get(galleryUri)?.push({
92
92
...photo,
93
-
galleryItemUri: item.uri,
93
+
item,
94
94
});
95
95
}
96
96
}
···
252
252
},
253
253
): Un$Typed<PhotoView> | undefined {
254
254
if (isPhoto(item)) {
255
-
return photoToView(did, item, item.exif, item.galleryItemUri);
255
+
return photoToView(did, item, item.exif, item.item);
256
256
}
257
257
return undefined;
258
258
}
+8
-2
src/lib/photo.ts
+8
-2
src/lib/photo.ts
···
40
40
did: string,
41
41
photo: WithBffMeta<Photo>,
42
42
exif?: WithBffMeta<PhotoExif>,
43
-
galleryItemUri?: string,
43
+
item?: WithBffMeta<GalleryItem>,
44
44
): $Typed<PhotoView> {
45
45
return {
46
46
$type: "social.grain.photo.defs#photoView",
···
51
51
alt: photo.alt,
52
52
aspectRatio: photo.aspectRatio,
53
53
exif: exif ? exifToView(exif) : undefined,
54
-
gallery: galleryItemUri ? { item: galleryItemUri } : undefined,
54
+
gallery: item
55
+
? {
56
+
item: item.uri,
57
+
itemPosition: item.position,
58
+
itemCreatedAt: item.createdAt,
59
+
}
60
+
: undefined,
55
61
};
56
62
}
57
63