'Import all torrent files in the collected torrent dir, all the files already in the database will be ignored.'

def reimport_torrents(self):

    self.status_update_func('Opening    TorrentDBHandler...')
    torrent_db_handler = TorrentDBHandler(self.session)
    torrent_db_handler.category = Category()
    self.status_update_func('Registering    recovered    torrents...')
    try:
        for (infoshash_str, torrent_data) in self.torrent_store.iteritems():
            self.status_update_func(('>    %s' % infoshash_str))
            torrentdef = TorrentDef.load_from_memory(torrent_data)
            if torrentdef.is_finalized():
                infohash = torrentdef.get_infohash()
                if (not torrent_db_handler.hasTorrent(infohash)):
                    self.status_update_func((u'Registering    recovered    torrent:    %s' % hexlify(infohash)))
                    torrent_db_handler._addTorrentToDB(torrentdef, extra_info={'filename': infoshash_str})
    finally:
        torrent_db_handler.close()
        self.db.commit_now()
        return self.torrent_store.flush()
