mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 22:02:54 +00:00
Preserve playback metadata in watch history
This commit is contained in:
1 parent
b5ee063260
commit
4d367109d5
5 files changed
+302
-3
No files matched your search
+1
-1
@@ -338,7 +338,7 @@ function getPointerVideoId(video, pointer) {
|
||||
return "";
|
||||
}
|
||||
|
||||
function buildHistoryCard({
|
||||
export function buildHistoryCard({
|
||||
item,
|
||||
video,
|
||||
profile,
|
||||
|
||||
@@ -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 : "",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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 : "",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
: "",
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user