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.misc_db = self._misc_db t.torrent_db = self._torrent_db t.channelcast_db = self._channelcast_db #t.metadata_db = self._metadata_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', 'swift_hash', 'swift_torrent_hash', 'name', 'torrent_file_name', 'length', 'category_id', 'status_id', 'num_seeders', 'num_leechers']) if dict: t = Torrent(dict['C.torrent_id'], dict['infohash'], dict['swift_hash'], dict['swift_torrent_hash'], dict['name'], dict['torrent_file_name'], dict['length'], dict['category_id'], dict['status_id'], dict['num_seeders'], dict['num_leechers'], None) t.misc_db = self._misc_db 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
def _get_torrent_from_infohash(self, infohash): dict = self._torrent_db.getTorrent( infohash, keys=[ 'C.torrent_id', 'infohash', 'swift_hash', 'swift_torrent_hash', 'name', 'torrent_file_name', 'length', 'category_id', 'status_id', 'num_seeders', 'num_leechers' ]) if dict: t = Torrent(dict['C.torrent_id'], dict['infohash'], dict['swift_hash'], dict['swift_torrent_hash'], dict['name'], dict['torrent_file_name'], dict['length'], dict['category_id'], dict['status_id'], dict['num_seeders'], dict['num_leechers'], None) t.misc_db = self._misc_db 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