media-server / src /getStats.mts
jbilcke-hf's picture
jbilcke-hf HF staff
add a system to recover from broken generation cycles
f7f7c46
raw
history blame
501 Bytes
import { promises as fs } from 'node:fs'
export const getStats = async () => {
const videoFilePaths = await fs.readdir(process.env.WEBTV_VIDEO_STORAGE_PATH_NEXT)
const legacyVideoFilePaths = await fs.readdir(process.env.WEBTV_VIDEO_STORAGE_PATH)
const legacyAudioFilePaths = await fs.readdir(process.env.WEBTV_AUDIO_STORAGE_PATH)
return {
nbVideoFiles: videoFilePaths.length,
nbLegacyVideoFiles: legacyVideoFilePaths.length,
nbLegacyAudioFiles: legacyAudioFilePaths.length,
}
}