'Renames all the torrent files to INFOHASH.torrent and delete unparseable ones.'

def _ingest_torrent_files(self):

    def update_status():
        progress = 1.0
        if (self.total_torrent_file_count > 0):
            progress = (float(self.total_torrent_files_processed) / self.total_torrent_file_count)
        progress *= 100
        self.status_update_func((u'Ingesting    torrent    files    %.1f%%    (%d/%d)...' % (progress, self.torrent_files_migrated, self.torrent_files_dropped)))
    self.status_update_func('Ingesting    torrent    files...')
    for (root, _, files) in os.walk(self.torrent_collecting_dir):
        for name in files:
            file_path = os.path.join(root, name)
            try:
                tdef = TorrentDef.load(file_path)
                with open(file_path, 'rb') as torrent_file:
                    self.torrent_store[hexlify(tdef.infohash)] = torrent_file.read()
                self.torrent_files_migrated += 1
            except Exception as e:
                self._logger.error(u'dropping    corrupted    torrent    file    %s:    %s', file_path, str(e))
                self.torrent_files_dropped += 1
            os.unlink(file_path)
            self.total_torrent_files_processed += 1
            if (not (self.total_torrent_files_processed % 2000)):
                self.torrent_store.flush()
            update_status()
        break
    self.status_update_func('All    torrent    files    processed.')
