mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-25 09:35:16 +00:00
Wait on the session state before requesting torrent status updates
This commit is contained in:
parent
25afa04ba3
commit
8fc4caa2f1
@ -159,6 +159,9 @@ class TorrentView(listview.ListView, component.Component):
|
|||||||
"torrentview.state")
|
"torrentview.state")
|
||||||
log.debug("TorrentView Init..")
|
log.debug("TorrentView Init..")
|
||||||
|
|
||||||
|
# If we have gotten the state yet
|
||||||
|
self.got_state = False
|
||||||
|
|
||||||
# This is where status updates are put
|
# This is where status updates are put
|
||||||
self.status = {}
|
self.status = {}
|
||||||
|
|
||||||
@ -265,6 +268,7 @@ class TorrentView(listview.ListView, component.Component):
|
|||||||
self.mark_dirty(torrent_id)
|
self.mark_dirty(torrent_id)
|
||||||
self.treeview.set_model(model)
|
self.treeview.set_model(model)
|
||||||
self.treeview.thaw_child_notify()
|
self.treeview.thaw_child_notify()
|
||||||
|
self.got_state = True
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
@ -328,6 +332,7 @@ class TorrentView(listview.ListView, component.Component):
|
|||||||
self.filter, status_keys, True).addCallback(self._on_get_torrents_status)
|
self.filter, status_keys, True).addCallback(self._on_get_torrents_status)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
if self.got_state:
|
||||||
# Send a status request
|
# Send a status request
|
||||||
gobject.idle_add(self.send_status_request)
|
gobject.idle_add(self.send_status_request)
|
||||||
|
|
||||||
@ -354,6 +359,7 @@ class TorrentView(listview.ListView, component.Component):
|
|||||||
for column in self.columns_to_update:
|
for column in self.columns_to_update:
|
||||||
column_index = self.get_column_index(column)
|
column_index = self.get_column_index(column)
|
||||||
for i, status_field in enumerate(self.columns[column].status_field):
|
for i, status_field in enumerate(self.columns[column].status_field):
|
||||||
|
if status_field in status[torrent_id]:
|
||||||
try:
|
try:
|
||||||
# Only update if different
|
# Only update if different
|
||||||
row_value = status[torrent_id][status_field]
|
row_value = status[torrent_id][status_field]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user