Merge pull request #1440 from webtorrent/Borewit-dependency/update-music-metadata
Small fixes added on top of #1435 by @Borewit. Merging this one which is already approved and has those fixes. We can continue making enhancements on top of this :) Thanks guys!
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
"location-history": "^1.0.0",
|
||||
"material-ui": "^0.17.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"music-metadata": "^2.0.1",
|
||||
"music-metadata": "^2.4.2",
|
||||
"network-address": "^1.1.0",
|
||||
"parse-torrent": "^6.0.1",
|
||||
"prettier-bytes": "^1.0.1",
|
||||
|
||||
@@ -292,7 +292,7 @@ module.exports = class PlaybackController {
|
||||
}
|
||||
|
||||
function getAudioMetadata () {
|
||||
if (state.playing.type === 'audio' && !fileSummary.audioInfo) {
|
||||
if (state.playing.type === 'audio') {
|
||||
ipcRenderer.send('wt-get-audio-metadata', torrentSummary.infoHash, index)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ const captureFrame = require('capture-frame')
|
||||
const path = require('path')
|
||||
|
||||
const mediaExtensions = {
|
||||
audio: ['.aac', '.asf', '.flac', '.m2a', '.m4a', '.mp2', '.mp4', '.mp3', '.oga', '.ogg', '.opus',
|
||||
'.wma', '.wav', '.wv', '.wvp'],
|
||||
audio: [
|
||||
'.aac', '.asf', '.flac', '.m2a', '.m4a', '.m4b', '.mp2', '.mp4',
|
||||
'.mp3', '.oga', '.ogg', '.opus', '.wma', '.wav', '.wv', '.wvp'
|
||||
],
|
||||
video: ['.mp4', '.m4v', '.webm', '.mov', '.mkv'],
|
||||
image: ['.gif', '.jpg', '.jpeg', '.png']
|
||||
}
|
||||
|
||||
@@ -286,10 +286,10 @@ function renderAudioMetadata (state) {
|
||||
format.push(fileSummary.audioInfo.format.dataformat)
|
||||
}
|
||||
if (fileSummary.audioInfo.format.bitrate) {
|
||||
format.push(fileSummary.audioInfo.format.bitrate / 1000 + ' kbps')
|
||||
format.push(Math.round(fileSummary.audioInfo.format.bitrate / 1000) + ' kbps') // 128 kbps
|
||||
}
|
||||
if (fileSummary.audioInfo.format.sampleRate) {
|
||||
format.push(fileSummary.audioInfo.format.sampleRate / 1000 + ' kHz')
|
||||
format.push(Math.round(fileSummary.audioInfo.format.sampleRate / 100) / 10 + ' kHz') // 44.1 kHz
|
||||
}
|
||||
if (fileSummary.audioInfo.format.bitsPerSample) {
|
||||
format.push(fileSummary.audioInfo.format.bitsPerSample + ' bit')
|
||||
|
||||
Reference in New Issue
Block a user