summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzlg <zlg@zlg.space>2018-03-18 17:50:07 -0700
committerzlg <zlg@zlg.space>2018-03-18 17:50:07 -0700
commit7686f310447e56518d3959c0aa7d62a69c3fb789 (patch)
treefdfe9dc90b609204b1a6905b59233a15911b4e60
parentUpdate helpers a bit (diff)
downloadvgstash-7686f310447e56518d3959c0aa7d62a69c3fb789.tar.gz
vgstash-7686f310447e56518d3959c0aa7d62a69c3fb789.tar.bz2
vgstash-7686f310447e56518d3959c0aa7d62a69c3fb789.tar.xz
vgstash-7686f310447e56518d3959c0aa7d62a69c3fb789.zip
add 'playlog' list filter
This filter is used to get an idea of which games you're currently playing through, so you can prioritize games to play when you're bored and detect it when you've beaten a game but haven't marked it as such.
Diffstat (limited to '')
-rw-r--r--README.mdown3
-rwxr-xr-xvgstash8
2 files changed, 9 insertions, 2 deletions
diff --git a/README.mdown b/README.mdown
index d78c9ac..a8f323d 100644
--- a/README.mdown
+++ b/README.mdown
@@ -165,6 +165,9 @@ List games that you don't own.
* **wishlist**
List games that you don't own AND are fresh.
+* **playlog**
+List games that are marked 'in-progress', that you also own.
+
* **incomplete**
List games that have been beaten, but not completed, that you also own.
diff --git a/vgstash b/vgstash
index 253c77c..54101f1 100755
--- a/vgstash
+++ b/vgstash
@@ -95,6 +95,7 @@ def init_db(args):
conn.execute("CREATE VIEW owned AS SELECT rowid,* FROM games WHERE ownership = 1 ORDER BY system,title ASC;")
conn.execute("CREATE VIEW unowned AS SELECT rowid,* FROM games WHERE ownership = 0 ORDER BY system,title ASC;")
conn.execute("CREATE VIEW wishlist AS SELECT rowid,* FROM games WHERE ownership = 0 AND progress < 2 ORDER BY system,title ASC;")
+ conn.execute("CREATE VIEW playlog AS SELECT rowid,* FROM games WHERE ownership = 1 AND progress = 1 ORDER BY system,title ASC;")
print("Views created.")
conn.commit()
except sqlite3.OperationalError as e:
@@ -283,6 +284,7 @@ def list_games(args):
# works around that limitation.
conn = sqlite3.connect(DB_LOCATION)
conn.row_factory = sqlite3.Row
+ # TODO: turn this into an object. The command parser must match filter names, so there's no reason to duplicate work.
select_stmts = {
'allgames': "SELECT * FROM allgames",
'backlog': "SELECT * FROM backlog",
@@ -292,7 +294,8 @@ def list_games(args):
'incomplete': "SELECT * FROM incomplete",
'owned': "SELECT * FROM owned",
'unowned': "SELECT * FROM unowned",
- 'wishlist': "SELECT * FROM wishlist"
+ 'wishlist': "SELECT * FROM wishlist",
+ 'playlog': "SELECT * FROM playlog"
}
# We're emulating a do-while loop
first_pass = True
@@ -379,7 +382,8 @@ def main():
# 'list' command
parser_list = subparsers.add_parser('list', help="List your games with preset views")
- list_filters = ['all', 'backlog', 'complete', 'done', 'fresh', 'incomplete', 'owned', 'unowned', 'wishlist']
+ # TODO: don't repeat yourself! The filter list is essentially copied in list_games()
+ list_filters = ['all', 'backlog', 'complete', 'done', 'fresh', 'incomplete', 'owned', 'unowned', 'wishlist', 'playlog']
parser_list.add_argument('filter', nargs='?', choices=list_filters, default='all', help='Filter games accerding to preset queries. Valid filters: {}'.format(', '.join(list_filters)))
parser_list.add_argument('-r', '--raw', action="store_true", help="Output the list in a machine-readable format, separated by pipe characters.")
parser_list.set_defaults(func=list_games)
2018-10-06Remove ID field from DBzlg3-38/+46 2018-10-06cli: change "Status" heading to "Progress"zlg2-36/+40 2018-09-29Bump to 0.3alpha5 for PyPIzlg1-1/+1 2018-09-29cli: Add pretty printing to 'list' commandzlg3-17/+107 2018-09-08setup.py: Bump to alpha4 for PyPIzlg1-1/+1 2018-09-08cli: add '--raw' option to list commandzlg2-9/+45 2018-09-08Add remaining filters to vgstash packagezlg1-2/+11 2018-09-04Update LICENSE to match setup.pyzlg1-80/+67 2018-09-03Branch off from master with pytest, tox, clickzlg16-778/+779 2018-03-18Flesh out filter types and ownership statuszlg3-82/+144 2018-03-18README.mdown: break line correctlyzlg1-1/+1 2018-03-18add 'playlog' list filterzlg2-2/+9 2018-03-13Update helpers a bitzlg1-2/+9 2018-03-13Make VGSTASH_DB_LOCATION point to a filezlg2-21/+20 2016-11-18Remove settings from helpers.shZe Libertine Gamer1-5/+0 2016-11-15Correct phrasing in README.Ze Libertine Gamer1-4/+4 2016-11-13DerpZe Libertine Gamer1-0/+1 2016-11-03Improve error handling in shell scriptsZe Libertine Gamer4-3/+23 2016-10-24Correct run_again, add recursionZe Libertine Gamer1-0/+4 2016-10-21Add quotes to correct behavior for arglistZe Libertine Gamer1-1/+1 2016-10-14updater.sh: add recursion, error handlingZe Libertine Gamer1-43/+101 2016-10-14Correct pipe-handling behaviorZe Libertine Gamer1-1/+9 2016-10-12Clarify a method to move between platformsZe Libertine Gamer1-2/+5