add origin

This commit is contained in:
Worph
2026-09-16 14:55:28 +02:00
parent bd62be5f24
commit 1cddb7ef2d
+9
View File
@@ -451,10 +451,19 @@ async function registerSubtitle(
opts: SubtitleOpts, opts: SubtitleOpts,
): Promise<void> { ): Promise<void> {
// 1. Companion subtitle-file record (fileType=subtitle, lang, video backref). // 1. Companion subtitle-file record (fileType=subtitle, lang, video backref).
//
// `source/gateway:opensubtitles` is the SAME label meta-feeder-opensubtitles
// stamps on the records it mints (METADATA_KEYS.md §5), deliberately: a
// subtitle's provenance must not depend on which of the two paths fetched
// it, and meta-watch already reads that one prefix to name the provider.
// It belongs on the subtitle's own record rather than on the video's,
// because a subtitle fetched over the swarm by CID arrives without the
// video record — anything stored there does not travel with the file.
const companion: Record<string, string> = { const companion: Record<string, string> = {
fileType: 'subtitle', fileType: 'subtitle',
extension: opts.extension, extension: opts.extension,
subtitleLanguage: lang3, subtitleLanguage: lang3,
'source/gateway:opensubtitles': 'true',
[`videos/${videoCid}`]: 'true', [`videos/${videoCid}`]: 'true',
}; };
if (opts.fileName) companion.fileName = opts.fileName; if (opts.fileName) companion.fileName = opts.fileName;