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)
|
let parsed = JSON.parse(formatData.stdout)
|
||||||
if (!parsed || !parsed.format || !parsed.format.duration) throw new Error('Failed to parse metadata!')
|
if (!parsed || !parsed.format || !parsed.format.duration) throw new Error('Failed to parse metadata!')
|
||||||
parsed = parsed.format
|
parsed = parsed.format
|
||||||
|
|
||||||
let data = {
|
let data = {
|
||||||
file,
|
file,
|
||||||
duration: parseFloat(parsed.duration)
|
duration: parseFloat(parsed.duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Math.floor(data.duration) === 0) throw new Error('Invalid file type!')
|
||||||
|
|
||||||
if (parsed.tags) {
|
if (parsed.tags) {
|
||||||
for (let k in parsed.tags) {
|
for (let k in parsed.tags) {
|
||||||
let tagtype = k.toLowerCase()
|
let tagtype = k.toLowerCase()
|
||||||
|
Loading…
Reference in New Issue
Block a user