aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2021-10-16 18:26:14 -0700
committerzlg <zlg@zlg.space>2021-10-16 18:26:14 -0700
commite23f6da1fb50b28f63283852dc89046b468dd644 (patch)
tree979c7a5ed109066c518318e3a56db93ff7bef009
parenttox.ini: update to use Python 3.9 for virtualenv (diff)
downloadvgstash-e23f6da1fb50b28f63283852dc89046b468dd644.tar.gz
vgstash-e23f6da1fb50b28f63283852dc89046b468dd644.tar.bz2
vgstash-e23f6da1fb50b28f63283852dc89046b468dd644.tar.xz
vgstash-e23f6da1fb50b28f63283852dc89046b468dd644.zip
vgstash: Support 'member' ownership status
Games marked as a 'member' are members of a collection or bundle of *other* games. For example, Castlevania Advance Collection is available for PS4, Switch, and Xbox X, but the games contained within it are on GBA and SNES. This means the original games should be marked 'member' on ownership (and their progress tracked) while the collection entry should have its ownership tracked, but be marked unbeatable. As such, the 'owned' filter has been updated to exclude 'member' games, and there is a new 'members' filter to target *only* member games.
-rwxr-xr-xsrc/vgstash/__init__.py6
-rwxr-xr-xsrc/vgstash_cli.py13
2 files changed, 11 insertions, 8 deletions
diff --git a/src/vgstash/__init__.py b/src/vgstash/__init__.py
index 48ac055..d28e587 100755
--- a/src/vgstash/__init__.py
+++ b/src/vgstash/__init__.py
@@ -23,7 +23,8 @@ OWNERSHIP = {
'unowned': 0,
'physical': 1,
'digital': 2,
- 'both': 3
+ 'both': 3,
+ 'member': 4
}
DEFAULT_CONFIG = {
@@ -40,9 +41,10 @@ FILTERS = {
'digital': "SELECT * FROM games WHERE ownership = 2 ORDER BY system, title ASC",
'done': "SELECT * FROM games WHERE progress > 2 ORDER BY system, title ASC",
'incomplete': "SELECT * FROM games WHERE progress = 3 AND ownership > 0 ORDER BY system, title ASC",
+ 'members': "SELECT * FROM games WHERE ownership = 4 ORDER BY system, title ASC",
'new': "SELECT * FROM games WHERE progress = 1 ORDER BY system, title ASC",
'notes': "SELECT * FROM games WHERE notes NOT LIKE '' ORDER BY system, title ASC",
- 'owned': "SELECT * FROM games WHERE ownership > 0 ORDER BY system, title ASC",
+ 'owned': "SELECT * FROM games WHERE ownership > 0 AND ownership < 4 ORDER BY system, title ASC",
'physical': "SELECT * FROM games WHERE ownership = 1 ORDER BY system, title ASC",
'playlog': "SELECT * FROM games WHERE ownership > 0 AND progress = 2 ORDER BY system, title ASC",
'unowned': "SELECT * FROM games WHERE ownership = 0 ORDER BY system, title ASC",
diff --git a/src/vgstash_cli.py b/src/vgstash_cli.py
index 1967458..7b9a9b4 100755
--- a/src/vgstash_cli.py
+++ b/src/vgstash_cli.py
@@ -58,7 +58,7 @@ def row_format(row, width, header):
titlestr = "{: <{w}s}".format(row['title'][:twidth], w=twidth)
systemstr = "{: ^8s}".format(row['system'][:8])
# unowned, physical, digital, both
- ownltr = [' ', 'P', ' D', 'P D']
+ ownltr = [' ', 'P', ' D', 'P D', ' M']
ownstr = "{: <3s}".format(ownltr[row['ownership']])
progltr = {
0: '',
@@ -83,10 +83,11 @@ def add(title, system, ownership, progress, notes):
try:
db.add_game(game, update=False)
own_clause = (
- "do not own",
- "physically own",
- "digitally own",
- "digitally and physically own",
+ "do not own it",
+ "physically own it",
+ "digitally own it",
+ "digitally and physically own it",
+ "own it in a collection"
)
progress_clause = (
"cannot beat",
@@ -96,7 +97,7 @@ def add(title, system, ownership, progress, notes):
"have completed",
)
note_clause = "" if len(game.notes) == 0 else " It also has notes."
- click.echo("Added {} for {}. You {} it and {} it.{}".format(
+ click.echo("Added {} for {}. You {} and {} it.{}".format(
game.title,
game.system,
own_clause[game.ownership],