stupid bug
This commit is contained in:
		
							parent
							
								
									d81646e914
								
							
						
					
					
						commit
						48751c5814
					
				| 
						 | 
					@ -17,7 +17,7 @@ redis.on('ready', async function () {
 | 
				
			||||||
    const files = fs.readdirSync('videos')
 | 
					    const files = fs.readdirSync('videos')
 | 
				
			||||||
    const webmFiles = files.filter((file) => file.endsWith('.mp4'))
 | 
					    const webmFiles = files.filter((file) => file.endsWith('.mp4'))
 | 
				
			||||||
    webmFiles.forEach(async (f) => {
 | 
					    webmFiles.forEach(async (f) => {
 | 
				
			||||||
      const videoId = f.replace('.mp4', '')
 | 
					      const videoId = f.includes('_') ? f.split('_')[0] : f.replace('.mp4', '')
 | 
				
			||||||
      const isActive = await redis.get(videoId)
 | 
					      const isActive = await redis.get(videoId)
 | 
				
			||||||
      if (!isActive) {
 | 
					      if (!isActive) {
 | 
				
			||||||
        fs.unlinkSync(`./videos/${f}`)
 | 
					        fs.unlinkSync(`./videos/${f}`)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue