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:
DC
2016-05-16 08:03:21 -07:00
parent 9731d85ca3
commit d4e6c84279
4 changed files with 52 additions and 21 deletions

View File

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