Hydrate video cards with cached creator identity

This commit is contained in:
thePR0M3TH3AN committed 2025-10-27 19:03:31 -04:00
1 parent 9e8afa8f6d
commit 3ef44a6651
4 files changed
+450 -31

No files matched your search

+29
View File
@@ -556,6 +556,34 @@ export class VideoListView {
this.utils.persistWatchHistoryMetadata(video, pointerInfo);
}
const identity = {
name:
typeof video.creatorName === "string" && video.creatorName
? video.creatorName
: typeof video.authorName === "string"
? video.authorName
: "",
picture:
typeof video.creatorPicture === "string" && video.creatorPicture
? video.creatorPicture
: typeof video.authorPicture === "string"
? video.authorPicture
: "",
pubkey: typeof video.pubkey === "string" ? video.pubkey : "",
npub:
typeof video.npub === "string" && video.npub
? video.npub
: typeof video.authorNpub === "string"
? video.authorNpub
: "",
shortNpub:
typeof video.shortNpub === "string" && video.shortNpub
? video.shortNpub
: typeof video.creatorNpub === "string"
? video.creatorNpub
: "",
};
const videoCard = new VideoCard({
document: this.document,
video,
@@ -566,6 +594,7 @@ export class VideoListView {
postedAt: normalizedPostedAt,
cardState,
motionState,
identity,
nsfwContext: {
isNsfw: video?.isNsfw === true,
allowNsfw: this.allowNsfw,