aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-09 11:23:02 +0100
committerChocobozzz <me@florianbigard.com>2021-12-09 11:23:02 +0100
commit6ba93fa6392429f22d338f3cdce50707995ced3b (patch)
tree58b7ad9976109464d8a70e53c061168747ef5930 /server/controllers/api
parent2acb622cb8f6b273ba9a03d5e37630d19a3d3e30 (diff)
downloadPeerTube-6ba93fa6392429f22d338f3cdce50707995ced3b.tar.gz
PeerTube-6ba93fa6392429f22d338f3cdce50707995ced3b.tar.zst
PeerTube-6ba93fa6392429f22d338f3cdce50707995ced3b.zip
Fix torrent metadata update for hls
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/update.ts11
1 files changed, 10 insertions, 1 deletions
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
202} 202}
203 203
204async function updateTorrentsMetadata (video: MVideoFullLight) { 204async function updateTorrentsMetadata (video: MVideoFullLight) {
205 for (const file of video.getAllFiles()) { 205 for (const file of (video.VideoFiles || [])) {
206 await updateTorrentMetadata(video, file) 206 await updateTorrentMetadata(video, file)
207 207
208 await file.save() 208 await file.save()
209 } 209 }
210
211 const hls = video.getHLSPlaylist()
212 if (!hls) return
213
214 for (const file of (hls.VideoFiles || [])) {
215 await updateTorrentMetadata(hls, file)
216
217 await file.save()
218 }
210} 219}