mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-13 11:48:40 +00:00
Make sure the queue state is saved whenever there is a change.
This commit is contained in:
parent
280eed95b6
commit
d64ed7e2e4
1 changed files with 9 additions and 2 deletions
|
@ -76,16 +76,19 @@ class TorrentQueue:
|
||||||
"""Append torrent_id to the bottom of the queue"""
|
"""Append torrent_id to the bottom of the queue"""
|
||||||
log.debug("Append torrent %s to queue..", torrent_id)
|
log.debug("Append torrent %s to queue..", torrent_id)
|
||||||
self.queue.append(torrent_id)
|
self.queue.append(torrent_id)
|
||||||
|
self.save_state()
|
||||||
|
|
||||||
def prepend(self, torrent_id):
|
def prepend(self, torrent_id):
|
||||||
"""Prepend torrent_id to the top of the queue"""
|
"""Prepend torrent_id to the top of the queue"""
|
||||||
log.debug("Prepend torrent %s to queue..", torrent_id)
|
log.debug("Prepend torrent %s to queue..", torrent_id)
|
||||||
self.queue.insert(0, torrent_id)
|
self.queue.insert(0, torrent_id)
|
||||||
|
self.save_state()
|
||||||
|
|
||||||
def remove(self, torrent_id):
|
def remove(self, torrent_id):
|
||||||
"""Removes torrent_id from the list"""
|
"""Removes torrent_id from the list"""
|
||||||
log.debug("Remove torrent %s from queue..", torrent_id)
|
log.debug("Remove torrent %s from queue..", torrent_id)
|
||||||
self.queue.remove(torrent_id)
|
self.queue.remove(torrent_id)
|
||||||
|
self.save_state()
|
||||||
|
|
||||||
def up(self, torrent_id):
|
def up(self, torrent_id):
|
||||||
"""Move torrent_id up one in the queue"""
|
"""Move torrent_id up one in the queue"""
|
||||||
|
@ -104,6 +107,8 @@ class TorrentQueue:
|
||||||
# Pop and insert the torrent_id at index - 1
|
# Pop and insert the torrent_id at index - 1
|
||||||
self.queue.insert(index - 1, self.queue.pop(index))
|
self.queue.insert(index - 1, self.queue.pop(index))
|
||||||
|
|
||||||
|
self.save_state()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def top(self, torrent_id):
|
def top(self, torrent_id):
|
||||||
|
@ -142,6 +147,8 @@ class TorrentQueue:
|
||||||
# Pop and insert the torrent_id at index + 1
|
# Pop and insert the torrent_id at index + 1
|
||||||
self.queue.insert(index + 1, self.queue.pop(index))
|
self.queue.insert(index + 1, self.queue.pop(index))
|
||||||
|
|
||||||
|
self.save_state()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def bottom(self, torrent_id):
|
def bottom(self, torrent_id):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue