On some "race" conditions, the torrent is removed before it's status could be retrieved. Return an empty status.
This commit is contained in:
parent
9d29ca7b29
commit
ffd344d0b5
@ -412,7 +412,11 @@ class Core(component.Component):
|
|||||||
@export
|
@export
|
||||||
def get_torrent_status(self, torrent_id, keys, diff=False):
|
def get_torrent_status(self, torrent_id, keys, diff=False):
|
||||||
# Build the status dictionary
|
# Build the status dictionary
|
||||||
status = self.torrentmanager[torrent_id].get_status(keys, diff)
|
try:
|
||||||
|
status = self.torrentmanager[torrent_id].get_status(keys, diff)
|
||||||
|
except KeyError:
|
||||||
|
# Torrent was probaly removed meanwhile
|
||||||
|
return {}
|
||||||
|
|
||||||
# Get the leftover fields and ask the plugin manager to fill them
|
# Get the leftover fields and ask the plugin manager to fill them
|
||||||
leftover_fields = list(set(keys) - set(status.keys()))
|
leftover_fields = list(set(keys) - set(status.keys()))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user