import { ParsedStream } from '../db/schemas'; class StreamUtils { public createDownloadableStream(stream: ParsedStream): ParsedStream { const copy = structuredClone(stream); copy.url = undefined; copy.externalUrl = stream.url; copy.message = `Download the stream above via your browser`; copy.id = `${stream.id}-external-download`; copy.type = 'external'; // remove uneccessary info that is already present in the original stream above copy.parsedFile = undefined; copy.size = undefined; copy.folderSize = undefined; copy.torrent = undefined; copy.indexer = undefined; copy.age = undefined; copy.duration = undefined; copy.folderName = undefined; copy.filename = undefined; return copy; } } export default StreamUtils;