not pausing active torrents when playing an already downloaded torrent.
This commit is contained in:
@@ -26,14 +26,7 @@ module.exports = class PlaybackController {
|
|||||||
// * Stream, if not already fully downloaded
|
// * Stream, if not already fully downloaded
|
||||||
// * If no file index is provided, pick the default file to play
|
// * If no file index is provided, pick the default file to play
|
||||||
playFile (infoHash, index /* optional */) {
|
playFile (infoHash, index /* optional */) {
|
||||||
// playback priority: pause all active torrents
|
this.pauseActiveTorrents(infoHash)
|
||||||
if (this.state.saved.prefs.highestPlaybackPriority) {
|
|
||||||
var params = {
|
|
||||||
filter: {status: /downloading|seeding/},
|
|
||||||
excluded: [infoHash]
|
|
||||||
}
|
|
||||||
dispatch('pauseAllTorrents', params)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.state.location.go({
|
this.state.location.go({
|
||||||
url: 'player',
|
url: 'player',
|
||||||
@@ -47,6 +40,24 @@ module.exports = class PlaybackController {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pauseActiveTorrents (infoHash) {
|
||||||
|
// playback priority: pause all active torrents if needed
|
||||||
|
if (this.state.saved.prefs.highestPlaybackPriority) {
|
||||||
|
// do not pause active torrents if playing a fully downloaded torrent
|
||||||
|
var torrentSummary = TorrentSummary.getByKey(this.state, infoHash)
|
||||||
|
if (torrentSummary.status === 'seeding') {
|
||||||
|
console.log('--- NOT PAUSING active torrents for already downloaded torrent!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var params = {
|
||||||
|
filter: {status: /downloading|seeding/},
|
||||||
|
excluded: [infoHash]
|
||||||
|
}
|
||||||
|
dispatch('pauseAllTorrents', params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Open a file in OS default app.
|
// Open a file in OS default app.
|
||||||
openItem (infoHash, index) {
|
openItem (infoHash, index) {
|
||||||
var torrentSummary = TorrentSummary.getByKey(this.state, infoHash)
|
var torrentSummary = TorrentSummary.getByKey(this.state, infoHash)
|
||||||
|
|||||||
Reference in New Issue
Block a user