duration criteria better
This commit is contained in:
parent
c6f2b8feed
commit
790516e385
@ -87,12 +87,14 @@ async function getInfos (file) {
|
||||
let parsed = JSON.parse(formatData.stdout)
|
||||
if (!parsed || !parsed.format || !parsed.format.duration) throw new Error('Failed to parse metadata!')
|
||||
parsed = parsed.format
|
||||
|
||||
|
||||
let data = {
|
||||
file,
|
||||
duration: parseFloat(parsed.duration)
|
||||
}
|
||||
|
||||
if (Math.floor(data.duration) === 0) throw new Error('Invalid file type!')
|
||||
|
||||
if (parsed.tags) {
|
||||
for (let k in parsed.tags) {
|
||||
let tagtype = k.toLowerCase()
|
||||
|
Loading…
Reference in New Issue
Block a user