mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 04:24:27 +00:00
[#2941] Remove tracker_status translation markup from core
* A UnicodeDecodeError can occur if creating a string using translated text but we should not be translating anything in core anyway so remove the markup and do the translating in UI.
This commit is contained in:
parent
739537f860
commit
0b4627be8a
@ -91,7 +91,7 @@ def tracker_error_filter(torrent_ids, values):
|
||||
# Check all the torrent's tracker_status for 'Error:' and only return torrent_ids
|
||||
# that have this substring in their tracker_status
|
||||
for torrent_id in torrent_ids:
|
||||
if _("Error") + ":" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
|
||||
if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
|
||||
filtered_torrent_ids.append(torrent_id)
|
||||
|
||||
return filtered_torrent_ids
|
||||
|
@ -1014,7 +1014,7 @@ class TorrentManager(component.Component):
|
||||
|
||||
# Set the tracker status for the torrent
|
||||
if alert.message() != "Got peers from DHT":
|
||||
torrent.set_tracker_status(_("Announce OK"))
|
||||
torrent.set_tracker_status("Announce OK")
|
||||
|
||||
# Check to see if we got any peer information from the tracker
|
||||
if alert.handle.status().num_complete == -1 or \
|
||||
@ -1030,7 +1030,7 @@ class TorrentManager(component.Component):
|
||||
return
|
||||
|
||||
# Set the tracker status for the torrent
|
||||
torrent.set_tracker_status(_("Announce Sent"))
|
||||
torrent.set_tracker_status("Announce Sent")
|
||||
|
||||
def on_alert_tracker_warning(self, alert):
|
||||
log.debug("on_alert_tracker_warning")
|
||||
@ -1038,7 +1038,7 @@ class TorrentManager(component.Component):
|
||||
torrent = self.torrents[str(alert.handle.info_hash())]
|
||||
except:
|
||||
return
|
||||
tracker_status = '%s: %s' % (_("Warning"), decode_string(alert.message()))
|
||||
tracker_status = '%s: %s' % ("Warning", decode_string(alert.message()))
|
||||
# Set the tracker status for the torrent
|
||||
torrent.set_tracker_status(tracker_status)
|
||||
|
||||
@ -1055,7 +1055,7 @@ class TorrentManager(component.Component):
|
||||
except (RuntimeError, KeyError):
|
||||
return
|
||||
|
||||
torrent.set_tracker_status("%s: %s" % (_("Error"), error_message))
|
||||
torrent.set_tracker_status("Error: %s" % error_message)
|
||||
|
||||
def on_alert_storage_moved(self, alert):
|
||||
log.debug("on_alert_storage_moved")
|
||||
|
Loading…
x
Reference in New Issue
Block a user