diff options
Diffstat (limited to 'gamechestcli/gamechest/statusdb.py')
-rw-r--r-- | gamechestcli/gamechest/statusdb.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gamechestcli/gamechest/statusdb.py b/gamechestcli/gamechest/statusdb.py index e343d8e..4c490a2 100644 --- a/gamechestcli/gamechest/statusdb.py +++ b/gamechestcli/gamechest/statusdb.py @@ -66,18 +66,12 @@ class StatusDB: game_info['id'], )) - #def get_installed_game_name(self, game_id): - # row = ( - # self.conn - # .execute('SELECT version_installed FROM status WHERE game_id = ?', - # (game_id, )) - # .fetchone() - # ) - # if row is None: - # #return False - # raise ValueError('Game not found') - # version_installed = row[0] - # return f'{game_id}_v{version_installed}' + def get_installed(self): + for row in ( + self.conn + .execute('SELECT game_id FROM status WHERE installed = 1') + ): + yield row[0] def set_uninstalled(self, game_info): return self.set_installed(game_info, installed=False) |