import { uniq, values } from 'lodash'
import { ThumbnailType } from '@shared/models'
import { VideoFileModel } from '@server/models/video/video-file'
+import { HLS_REDUNDANCY_DIRECTORY } from '@server/initializers/constants'
run()
.then(() => process.exit(0))
const isPlaylist = (await stat(filePath)).isDirectory()
if (isPlaylist) {
+ // Don't delete HLS directory
+ if (filePath === HLS_REDUNDANCY_DIRECTORY) return true
+
const uuid = getUUIDFromFilename(filePath)
const video = await VideoModel.loadWithFiles(uuid)
if (!video) return false