def __init__(self): self.path = os.path.join(player_get_data_dir(), 'requests.db') self.connection = sqlite3.connect( self.path, isolation_level='immediate') self.cursor = self.connection.cursor() self.create_table() self.cached_song = None
def __init__(self): data_dir = player_get_data_dir() self.db_path = os.path.join(data_dir, "similarity.db") self.gaia_db_path = os.path.join(data_dir, "gaia.db") self.db_queue = PriorityQueue() self._db_wrapper = DatabaseWrapper() self._db_wrapper.daemon = True self._db_wrapper.set_path(self.db_path) self._db_wrapper.set_queue(self.db_queue) self._db_wrapper.start() self.create_db() self.network = LastFMNetwork(api_key=API_KEY) self.cache_time = 90 if GAIA: self.gaia_queue = LifoQueue() self.gaia_analyser = GaiaAnalysis(self.gaia_db_path, self.gaia_queue) self.gaia_analyser.daemon = True self.gaia_analyser.start()
def __init__(self): data_dir = player_get_data_dir() self.db_path = os.path.join(data_dir, "similarity.db") self.gaia_db_path = os.path.join(data_dir, "gaia.db") self.db_queue = PriorityQueue() self._db_wrapper = DatabaseWrapper() self._db_wrapper.daemon = True self._db_wrapper.set_path(self.db_path) self._db_wrapper.set_queue(self.db_queue) self._db_wrapper.start() self.create_db() self.network = LastFMNetwork(api_key=API_KEY) self.cache_time = 90 if GAIA: self.gaia_queue = LifoQueue() self.gaia_analyser = GaiaAnalysis( self.gaia_db_path, self.gaia_queue) self.gaia_analyser.daemon = True self.gaia_analyser.start()