Pass FileInfo into music-metadata.parseStream() according API v6.
Update metadata if music-metadata parse method resolves.
This commit is contained in:
@@ -351,15 +351,18 @@ function getAudioMetadata (infoHash, index) {
|
|||||||
ipc.send('wt-audio-metadata', infoHash, index, event.metadata)
|
ipc.send('wt-audio-metadata', infoHash, index, event.metadata)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onMetaData = file.done
|
const onMetadata = file.done
|
||||||
// If completed; use direct file access
|
// If completed; use direct file access
|
||||||
? mm.parseFile(path.join(torrent.path, file.path), options)
|
? mm.parseFile(path.join(torrent.path, file.path), options)
|
||||||
// otherwise stream
|
// otherwise stream
|
||||||
: mm.parseStream(file.createReadStream(), file.name, options)
|
: mm.parseStream(file.createReadStream(), file.name, options)
|
||||||
|
|
||||||
onMetaData
|
onMetadata
|
||||||
.then(
|
.then(
|
||||||
() => console.log(`metadata for file='${file.name}' completed.`),
|
metadata => {
|
||||||
|
ipc.send('wt-audio-metadata', infoHash, index, metadata)
|
||||||
|
console.log(`metadata for file='${file.name}' completed.`)
|
||||||
|
},
|
||||||
err => {
|
err => {
|
||||||
console.log(
|
console.log(
|
||||||
`error getting audio metadata for ${infoHash}:${index}`,
|
`error getting audio metadata for ${infoHash}:${index}`,
|
||||||
|
|||||||
Reference in New Issue
Block a user