refactor streamer to use stream providers (e.g. to plugin web torrent)

This commit is contained in:
Jurgis Sakalauskas
2023-01-04 14:26:05 +02:00
parent 8c900a774e
commit 3c9ea2fb39
13 changed files with 123 additions and 56 deletions
+3 -3
View File
@@ -136,12 +136,12 @@ export class AllFilesService {
if (isNaN(id)) {
throw new NotFoundException(`id #${fileId} not correct`);
}
const filePath = await this.videoTitlesProvider.getFilePath(id);
const fileEntity = await this.videoTitlesProvider.getFile(id);
if (filePath === null) {
if (fileEntity === null) {
throw new NotFoundException(`id #${fileId} not found`);
}
return this.streamerFacade.streamFile(request, response, filePath);
return this.streamerFacade.streamVideoFile(request, response, fileEntity);
}
}