mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-28 08:22:24 +00:00
Fix: prevent published date reset when editing videos and show edited status
Prioritize `published_at` metadata over event `created_at` timestamp. Backfill `published_at` during edit if missing to preserve original date. Add "(edited)" label to video cards for modified content. Display "Last Edited: [Date]" on video player modal.
This commit is contained in:
1 parent
1d3c827f62
commit
782b5fe0b7
1 file changed
+7
-6
@@ -8850,12 +8850,13 @@ class Application {
|
||||
}
|
||||
|
||||
// Prioritize NIP-71 published_at metadata if available
|
||||
const nip71PublishedAt = Number.isFinite(video?.nip71?.publishedAt)
|
||||
? Math.floor(video.nip71.publishedAt)
|
||||
: Number.isFinite(video?.nip71?.published_at)
|
||||
? Math.floor(video.nip71.published_at)
|
||||
: Number.isFinite(video?.nip71?.["published-at"])
|
||||
? Math.floor(video.nip71["published-at"])
|
||||
const rawNip71PublishedAt =
|
||||
video?.nip71?.publishedAt ||
|
||||
video?.nip71?.published_at ||
|
||||
video?.nip71?.["published-at"];
|
||||
const parsedNip71PublishedAt = Number(rawNip71PublishedAt);
|
||||
const nip71PublishedAt = Number.isFinite(parsedNip71PublishedAt)
|
||||
? Math.floor(parsedNip71PublishedAt)
|
||||
: null;
|
||||
|
||||
if (nip71PublishedAt !== null) {
|
||||
|
||||
Reference in new issue
Block a user