+ const isPlaylist = file.includes('.') === false
+
+ if (isPlaylist) {
+ const p = video.getHLSPlaylist()
+ if (!p) return false
+
+ const redundancy = await VideoRedundancyModel.loadLocalByStreamingPlaylistId(p.id)
+ return !!redundancy
+ }
+
+ const resolution = parseInt(file.split('-')[5], 10)
+ if (isNaN(resolution)) {
+ console.error('Cannot prune %s because we cannot guess guess the resolution.', file)
+ return true
+ }
+
+ const videoFile = video.getFile(resolution)
+ if (!videoFile) {
+ console.error('Cannot find file of video %s - %d', video.url, resolution)
+ return true
+ }