Closed kozlovsky closed 1 month ago
The error appears when right-clicking on the RATIO column's header in the downloads pane.
RATIO
Traceback (most recent call last): File "C:\\dev\\tribler\\src\\tribler\\gui\\widgets\\downloadwidgetitem.py", line 132, in __lt__ return float(self.download_info["ratio"]) > float(other.download_info["ratio"]) KeyError: 'ratio'
Here:
def __lt__(self, other): # The download info might not be available yet or there could still be loading QTreeWidgetItem if not self.download_info or not isinstance(other, DownloadWidgetItem): return True elif not other.download_info: return False column = self.treeWidget().sortColumn() if column == 1: return float(self.download_info["size"]) > float(other.download_info["size"]) elif column == 2: return int(self.download_info["progress"] * 100) > int(other.download_info["progress"] * 100) elif column == 4: return self.download_info["num_seeds"] > other.download_info["num_seeds"] elif column == 5: return self.download_info["num_peers"] > other.download_info["num_peers"] elif column == 6: return float(self.download_info["speed_down"]) > float(other.download_info["speed_down"]) elif column == 7: return float(self.download_info["speed_up"]) > float(other.download_info["speed_up"]) elif column == 8: return float(self.download_info["ratio"]) > float(other.download_info["ratio"]) # <-- here
The reason for the error is renaming the "ratio" dictionary field to all_time_ratio in #7817. We need to rename it here as well.
"ratio"
all_time_ratio
The error appears when right-clicking on the
RATIO
column's header in the downloads pane.Here:
The reason for the error is renaming the
"ratio"
dictionary field toall_time_ratio
in #7817. We need to rename it here as well.