Save video position

This commit is contained in:
DC
2016-05-20 23:57:50 -07:00
parent 8af4f42c42
commit ca7c872420
3 changed files with 23 additions and 7 deletions

View File

@@ -9,8 +9,7 @@ var LocationHistory = require('./lib/location-history')
module.exports = {
getInitialState,
getDefaultPlayState,
getDefaultSavedState,
getPlayingTorrentSummary
getDefaultSavedState
}
function getInitialState () {
@@ -63,7 +62,8 @@ function getInitialState () {
/*
* Getters, for convenience
*/
getPlayingTorrentSummary
getPlayingTorrentSummary,
getPlayingFileSummary
}
}
@@ -276,3 +276,9 @@ function getPlayingTorrentSummary () {
var infoHash = this.playing.infoHash
return this.saved.torrents.find((x) => x.infoHash === infoHash)
}
function getPlayingFileSummary () {
var torrentSummary = this.getPlayingTorrentSummary()
if (!torrentSummary) return null
return torrentSummary.files[this.playing.fileIndex]
}