Merge pull request #593 from mathiasvr/duplicate
Adding duplicate torrent when stopped
This commit is contained in:
@@ -828,12 +828,21 @@ function torrentInfoHash (torrentKey, infoHash) {
|
|||||||
torrentSummary ? 'existing' : 'new', torrentKey)
|
torrentSummary ? 'existing' : 'new', torrentKey)
|
||||||
|
|
||||||
if (!torrentSummary) {
|
if (!torrentSummary) {
|
||||||
torrentSummary = {
|
// Check if another torrent has the same infoHash
|
||||||
torrentKey: torrentKey,
|
var duplicate = state.saved.torrents.find((x) => x.infoHash === infoHash)
|
||||||
status: 'new'
|
|
||||||
|
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
|
torrentSummary.infoHash = infoHash
|
||||||
|
|||||||
Reference in New Issue
Block a user