From 6ba93fa6392429f22d338f3cdce50707995ced3b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 9 Dec 2021 11:23:02 +0100 Subject: Fix torrent metadata update for hls --- server/controllers/api/videos/update.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'server/controllers/api/videos/update.ts') diff --git a/server/controllers/api/videos/update.ts b/server/controllers/api/videos/update.ts index c0eb4ebee..e397127f3 100644 --- a/server/controllers/api/videos/update.ts +++ b/server/controllers/api/videos/update.ts @@ -202,9 +202,18 @@ function updateSchedule (videoInstance: MVideoFullLight, videoInfoToUpdate: Vide } async function updateTorrentsMetadata (video: MVideoFullLight) { - for (const file of video.getAllFiles()) { + for (const file of (video.VideoFiles || [])) { await updateTorrentMetadata(video, file) await file.save() } + + const hls = video.getHLSPlaylist() + if (!hls) return + + for (const file of (hls.VideoFiles || [])) { + await updateTorrentMetadata(hls, file) + + await file.save() + } } -- cgit v1.2.3