Merge branch 'master' into reuse-media-extensions

# Conflicts:
#	src/renderer/lib/torrent-poster.js
This commit is contained in:
Borewit
2018-08-13 21:45:14 +02:00
4 changed files with 10 additions and 7 deletions

View File

@@ -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",

View File

@@ -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)
}
}

View File

@@ -1,7 +1,10 @@
const mediaExtensions = {
audio: ['.aac', '.asf', '.flac', '.m2a', '.m4a', '.m4b', '.mp2', '.mp4', '.mp3', '.oga', '.ogg',
'.opus', '.wma', '.wav', '.wv', '.wvp'],
video: ['.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', 'mpg', 'mpeg', '.ogv', '.webm', '.wmv'],
audio: [
'.aac', '.asf', '.flac', '.m2a', '.m4a', '.m4b', '.mp2', '.mp4',
'.mp3', '.oga', '.ogg', '.opus', '.wma', '.wav', '.wv', '.wvp'],
video: [
'.avi', '.mp4', '.m4v', '.webm', '.mov', '.mkv', 'mpg', 'mpeg',
'.ogv', '.webm', '.wmv'],
image: ['.gif', '.jpg', '.jpeg', '.png']
}

View File

@@ -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')