Compare commits

..

1 Commits

Author SHA1 Message Date
Borewit
451212c7ae Update dependency music-metadata to ESM version v10.3.0 2024-08-29 21:15:38 +02:00
4 changed files with 763 additions and 650 deletions

View File

@@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '24'
node-version: '16'
- uses: actions/cache@v3
with:
path: ~/.npm
@@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '24'
node-version: '16'
- uses: actions/cache@v3
with:
path: ~/.npm
@@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '24'
node-version: '16'
- uses: actions/cache@v3
with:
path: ~/.npm

1359
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -21,7 +21,7 @@
"url": "https://github.com/webtorrent/webtorrent-desktop/issues"
},
"dependencies": {
"@electron/remote": "2.1.3",
"@electron/remote": "2.1.2",
"airplayer": "github:webtorrent/airplayer#fix-security",
"application-config": "2.0.0",
"arch": "2.2.0",
@@ -40,7 +40,7 @@
"languagedetect": "2.0.0",
"location-history": "1.1.2",
"material-ui": "0.20.2",
"music-metadata": "7.14.0",
"music-metadata": "^10.3.0",
"network-address": "1.1.2",
"parse-torrent": "9.1.5",
"prettier-bytes": "1.0.4",
@@ -58,10 +58,10 @@
"winreg": "1.2.4"
},
"devDependencies": {
"@babel/cli": "7.28.6",
"@babel/core": "7.29.0",
"@babel/eslint-parser": "7.28.6",
"@babel/plugin-transform-react-jsx": "7.28.6",
"@babel/cli": "7.24.8",
"@babel/core": "7.25.2",
"@babel/eslint-parser": "7.25.1",
"@babel/plugin-transform-react-jsx": "7.25.2",
"cross-zip": "4.0.0",
"depcheck": "1.4.7",
"electron": "27.3.11",
@@ -78,7 +78,7 @@
"run-series": "1.1.9",
"spectron": "19.0.0",
"standard": "17.0.0",
"tape": "5.9.0"
"tape": "5.8.1"
},
"engines": {
"node": "^16.0.0 || ^18.0.0",

View File

@@ -6,7 +6,7 @@ const crypto = require('crypto')
const util = require('util')
const { ipcRenderer } = require('electron')
const fs = require('fs')
const mm = require('music-metadata')
const { loadMusicMetadata } = require('music-metadata')
const networkAddress = require('network-address')
const path = require('path')
const WebTorrent = require('webtorrent')
@@ -345,25 +345,23 @@ function getAudioMetadata (infoHash, index) {
})
}
}
const onMetadata = file.done
// If completed; use direct file access
? mm.parseFile(path.join(torrent.path, file.path), options)
// otherwise stream
: mm.parseStream(file.createReadStream(), file.name, options)
onMetadata
.then(
metadata => {
ipcRenderer.send('wt-audio-metadata', infoHash, index, metadata)
console.log(`metadata for file='${file.name}' completed.`)
},
err => {
console.log(
`error getting audio metadata for ${infoHash}:${index}`,
err
)
}
loadMusicMetadata(mm => {
return file.done
// If completed; use direct file access
? mm.parseFile(path.join(torrent.path, file.path), options)
// otherwise stream
: mm.parseStream(file.createReadStream(), file.name, options)
}).then(metadata => {
ipcRenderer.send('wt-audio-metadata', infoHash, index, metadata)
console.log(`metadata for file='${file.name}' completed.`)
},
err => {
console.log(
`error getting audio metadata for ${infoHash}:${index}`,
err
)
})
}
function selectFiles (torrentOrInfoHash, selections) {