def received_search_result_torrent(self, result): torrent_index = bisect_right(result, self.search_results['torrents'], is_torrent=True) self.search_results['torrents'].insert(torrent_index, result) self.window().search_results_list.insert_item( torrent_index + len(self.search_results['channels']), (ChannelTorrentListItem, result)) self.update_num_search_results()
def received_search_result_torrent(self, result): if self.is_duplicate_torrent(result): return torrent_index = bisect_right(result, self.search_results['torrents'], is_torrent=True) num_channels_visible = len(self.search_results['channels']) if self.show_channels else 0 if self.show_torrents: self.window().search_results_list.insert_item( torrent_index + num_channels_visible, (ChannelTorrentListItem, result)) self.search_results['torrents'].insert(torrent_index, result) self.update_num_search_results()
def received_search_result_channel(self, result): # Ignore channels that have a small amount of torrents or have no votes if result['torrents'] <= 2 or result['votes'] == 0: return if self.is_duplicate_channel(result): return channel_index = bisect_right(result, self.search_results['channels'], is_torrent=False) if self.show_channels: self.window().search_results_list.insert_item(channel_index, (ChannelListItem, result)) self.search_results['channels'].insert(channel_index, result) self.update_num_search_results()