Add game_ownership (schema v10) and tools/check_ownership.py, compare the local library with GetOwnedGames, expose owned/shared counts and filters, and show a shared-game badge on cards.
This commit is contained in:
1 parent
528fcb7474
commit
2ed00b7912
18 files changed
+255
-10
No files matched your search
+15
-1
@@ -8,7 +8,7 @@ from datetime import datetime, timezone
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
DEFAULT_DB = os.path.join(BASE_DIR, "steam.db")
|
||||
SCHEMA_PATH = os.path.join(BASE_DIR, "tools", "schema.sql")
|
||||
SCHEMA_VERSION = 9
|
||||
SCHEMA_VERSION = 10
|
||||
|
||||
MOOD_PRESETS = {
|
||||
"adventure-rpg-party": {
|
||||
@@ -587,6 +587,19 @@ def _migration_9(con):
|
||||
con.execute("CREATE INDEX IF NOT EXISTS idx_games_parent ON games(parent_appid)")
|
||||
|
||||
|
||||
def _migration_10(con):
|
||||
"""Track which local games are owned by the Steam account."""
|
||||
con.execute("""
|
||||
CREATE TABLE IF NOT EXISTS game_ownership (
|
||||
appid INTEGER PRIMARY KEY REFERENCES games(appid) ON DELETE CASCADE,
|
||||
owned INTEGER NOT NULL,
|
||||
checked_at TEXT NOT NULL
|
||||
)
|
||||
""")
|
||||
con.execute("CREATE INDEX IF NOT EXISTS idx_game_ownership_owned "
|
||||
"ON game_ownership(owned)")
|
||||
|
||||
|
||||
MIGRATIONS = {
|
||||
1: _migration_1,
|
||||
2: _migration_2,
|
||||
@@ -597,6 +610,7 @@ MIGRATIONS = {
|
||||
7: _migration_7,
|
||||
8: _migration_8,
|
||||
9: _migration_9,
|
||||
10: _migration_10,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user