Adding duplicate torrent when stopped
This commit is contained in:
parent
1b8f180255
commit
7c7780b17e
1 changed files with 14 additions and 5 deletions
|
|
@ -878,12 +878,21 @@ function torrentInfoHash (torrentKey, infoHash) {
|
|||
torrentSummary ? 'existing' : 'new', torrentKey)
|
||||
|
||||
if (!torrentSummary) {
|
||||
torrentSummary = {
|
||||
torrentKey: torrentKey,
|
||||
status: 'new'
|
||||
// Check if another torrent has the same infoHash
|
||||
var duplicate = state.saved.torrents.find((x) => x.infoHash === infoHash)
|
||||
|
||||
if (duplicate) {
|
||||
duplicate.torrentKey = torrentKey
|
||||
duplicate.status = 'new'
|
||||
sound.play('ENABLE')
|
||||
} else {
|
||||
torrentSummary = {
|
||||
torrentKey: torrentKey,
|
||||
status: 'new'
|
||||
}
|
||||
state.saved.torrents.unshift(torrentSummary)
|
||||
sound.play('ADD')
|
||||
}
|
||||
state.saved.torrents.unshift(torrentSummary)
|
||||
sound.play('ADD')
|
||||
}
|
||||
|
||||
torrentSummary.infoHash = infoHash
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue