Automatically add subtitle tracks
Currently, add all .SRT and .VTT subtitle files in the same torrent as a video file
This commit is contained in:
@@ -9,7 +9,8 @@ var LocationHistory = require('./lib/location-history')
|
||||
module.exports = {
|
||||
getInitialState,
|
||||
getDefaultPlayState,
|
||||
getDefaultSavedState
|
||||
getDefaultSavedState,
|
||||
getPlayingTorrentSummary
|
||||
}
|
||||
|
||||
function getInitialState () {
|
||||
@@ -57,7 +58,12 @@ function getInitialState () {
|
||||
*
|
||||
* Also accessible via `require('application-config')('WebTorrent').filePath`
|
||||
*/
|
||||
saved: {}
|
||||
saved: {},
|
||||
|
||||
/*
|
||||
* Getters, for convenience
|
||||
*/
|
||||
getPlayingTorrentSummary
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,3 +270,8 @@ function getDefaultSavedState () {
|
||||
: remote.app.getPath('downloads')
|
||||
}
|
||||
}
|
||||
|
||||
function getPlayingTorrentSummary () {
|
||||
var infoHash = this.playing.infoHash
|
||||
return this.saved.torrents.find((x) => x.infoHash === infoHash)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user