Preserve playback metadata in watch history

This commit is contained in:
thePR0M3TH3AN committed 2025-10-09 19:23:29 -04:00
1 parent b5ee063260
commit 4d367109d5
5 files changed
+302 -3

No files matched your search

+1 -1
View File
@@ -338,7 +338,7 @@ function getPointerVideoId(video, pointer) {
return "";
}
function buildHistoryCard({
export function buildHistoryCard({
item,
video,
profile,
+3
View File
@@ -1374,6 +1374,9 @@ function cloneVideoMetadata(video) {
created_at: createdAt,
url: typeof video.url === "string" ? video.url : "",
magnet: typeof video.magnet === "string" ? video.magnet : "",
infoHash: typeof video.infoHash === "string" ? video.infoHash : "",
legacyInfoHash:
typeof video.legacyInfoHash === "string" ? video.legacyInfoHash : "",
};
}
+5
View File
@@ -36,6 +36,11 @@ function sanitizeVideoMetadata(video) {
thumbnail: typeof video.thumbnail === "string" ? video.thumbnail : "",
pubkey: typeof video.pubkey === "string" ? video.pubkey : "",
created_at: createdAt,
url: typeof video.url === "string" ? video.url : "",
magnet: typeof video.magnet === "string" ? video.magnet : "",
infoHash: typeof video.infoHash === "string" ? video.infoHash : "",
legacyInfoHash:
typeof video.legacyInfoHash === "string" ? video.legacyInfoHash : "",
};
}
+9
View File
@@ -253,6 +253,8 @@ function sanitizeVideoForStorage(video) {
pubkey: typeof video.pubkey === "string" ? video.pubkey : "",
created_at: createdAt,
infoHash: typeof video.infoHash === "string" ? video.infoHash : "",
legacyInfoHash:
typeof video.legacyInfoHash === "string" ? video.legacyInfoHash : "",
mode: typeof video.mode === "string" ? video.mode : "",
isPrivate: video?.isPrivate === true,
description:
@@ -274,6 +276,13 @@ function sanitizeVideoForHistory(video) {
created_at: sanitized.created_at,
url: sanitized.url,
magnet: sanitized.magnet,
infoHash: sanitized.infoHash,
legacyInfoHash:
typeof video?.legacyInfoHash === "string"
? video.legacyInfoHash
: typeof sanitized.legacyInfoHash === "string"
? sanitized.legacyInfoHash
: "",
};
}