Merge pull request #2716 from PR0M3TH3AN/refactor-app-extract-dtag-value-657233878683899686

Refactor extractDTagValue in js/app.js
This commit is contained in:
thePR0M3TH3AN authored and GitHub committed 2026-02-26 14:38:13 -05:00
commit 11250f681b
1 file changed
+2 -12
+2 -12
View File
@@ -2,6 +2,7 @@
import { nostrClient } from "./nostrClientFacade.js";
import { recordVideoView } from "./nostrViewEventsFacade.js";
import { getDTagValueFromTags } from "./nostr/nip71.js";
import { torrentClient } from "./webtorrent.js";
import { emit } from "./embedDiagnostics.js";
import {
@@ -1370,18 +1371,7 @@ class Application {
return this.similarContentController.extractDTagValue(tags);
}
// Fallback if controller not initialized (though it should be)
if (!Array.isArray(tags)) {
return "";
}
for (const tag of tags) {
if (!Array.isArray(tag) || tag.length < 2) {
continue;
}
if (tag[0] === "d" && typeof tag[1] === "string") {
return tag[1];
}
}
return "";
return getDTagValueFromTags(tags);
}
deriveVideoPointerInfo(video) {