File size: 339 Bytes
07ae658
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import { promises as fs } from 'node:fs'

export const getStats = async () => {
  const videoFilePaths = await fs.readdir(process.env.WEBTV_VIDEO_STORAGE_PATH)
  const audioFilePaths = await fs.readdir(process.env.WEBTV_AUDIO_STORAGE_PATH)

  return {
    nbVideoFiles: videoFilePaths.length,
    nbAudioFiles: audioFilePaths.length,
  }
}