def _get_torrent_from_infohash(self, infohash): dict = self._torrent_db.getTorrent(infohash, keys=['C.torrent_id', 'infohash', 'name', 'length', 'category', 'status', 'num_seeders', 'num_leechers']) if dict: t = Torrent(dict['C.torrent_id'], dict['infohash'], dict['name'], dict['length'], dict['category'], dict['status'], dict['num_seeders'], dict['num_leechers'], None) t.torrent_db = self._torrent_db t.channelcast_db = self._channelcast_db # prefetching channel, metadata _ = t.channel return t
def create_torrent(a): #channel = channels.get(a[-10], False) #if channel and (channel.isFavorite() or channel.isMyChannel()): # t = ChannelTorrent(*a[:-12] + [channel, None]) #else: t = Torrent(*a[:11] + [False]) t.torrent_db = self._torrent_db t.channelcast_db = self._channelcast_db t.assignRelevance(a[-11]) return t
def _get_torrent_from_infohash(self, infohash): dict = self._torrent_db.getTorrent(infohash, keys=[ 'C.torrent_id', 'infohash', 'name', 'length', 'category', 'status', 'num_seeders', 'num_leechers' ]) if dict: t = Torrent(dict['C.torrent_id'], dict['infohash'], dict['name'], dict['length'], dict['category'], dict['status'], dict['num_seeders'], dict['num_leechers'], None) t.torrent_db = self._torrent_db t.channelcast_db = self._channelcast_db # TODO: ENABLE metadata_db WHEN METADATA COMMUNITY IS ENABLED t.metadata_db = None #self._metadata_db # prefetching channel, metadata _ = t.channel _ = t.metadata return t