From c10181274d191a295b1f92263090e1119e7e7c2c Mon Sep 17 00:00:00 2001 From: mez Date: Tue, 29 Apr 2025 22:57:56 +0100 Subject: [PATCH] Track games more sensibly --- build/games/backloggery.css | 8 ++++ generate.py | 91 +++++++++++++++++++++---------------- 2 files changed, 59 insertions(+), 40 deletions(-) diff --git a/build/games/backloggery.css b/build/games/backloggery.css index 38e68ca..2f50ea4 100644 --- a/build/games/backloggery.css +++ b/build/games/backloggery.css @@ -144,6 +144,14 @@ a { text-decoration:none } +div#about_note a { + text-decoration: underline; +} + +div#about_note a:hover { + opacity: .7; +} + .link,a { color:var(--active-text) } diff --git a/generate.py b/generate.py index d51bdef..7122721 100644 --- a/generate.py +++ b/generate.py @@ -325,7 +325,7 @@ def unplayed(selection): gamehue = 250 -gamedescription = "I nicked this design and method of game tracking from Backloggery. I don’t have full data on when I obtained/started playing some of my games, so some of these statistics are inaccurate.

I classify games by the console I play them on, not the one they were released for, so there are PS4 games under PS5, GBA games under DS, etc.

“Complete” means getting all the achievements if it’s a game/platform that has them; otherwise it means getting in-game 100% completion.

Achievements and playtime are automatically tracked on exophase." +gamedescription = "I nicked this design and method of game tracking from Backloggery. I classify games by the console I play them on, not the one they were released for, so there are PS4 games under PS5, GBA games under DS, etc.

“Complete” means getting all the achievements if it’s a game/platform that has them; otherwise it means getting in-game 100% completion.

Achievements and playtime are automatically tracked on exophase." def headerwrite(output,section): header = open(output, "a") @@ -484,12 +484,21 @@ def playcard(game,decay=False): cardstring += "

\n \n
\n \n

" + game["lastupdate"].strftime("%Y-%m-%d") + "

\n
\n \n \n
\n
\n

Milestones

\n
\n
\n
" + game["initialdate"].strftime("%Y-%m-%d") + "
\n
\n
Added
\n
\n" try: if game["firstplayed"]: - cardstring += "
\n
" + game["firstplayed"].strftime("%Y-%m-%d") + "
\n
\n
Started
\n
\n" + try: + if game["firstplayed"] != game["beaten"]: + cardstring += "
\n
" + game["firstplayed"].strftime("%Y-%m-%d") + "
\n
\n
Started
\n
\n" + except: + cardstring += "
\n
" + game["firstplayed"].strftime("%Y-%m-%d") + "
\n
\n
Started
\n
\n" except: pass try: @@ -944,54 +953,53 @@ def history(): theyear = int(thisyear) while theyear >= gamestartyear: - yearlist = [] + histlist = [] + feedlist = [] enddate = datetime.strptime((str(theyear) + "-12-31"),"%Y-%m-%d") startdate = datetime.strptime((str(theyear) + "-01-01"),"%Y-%m-%d") eachdate = enddate while eachdate >= startdate: for game in games: - try: - if game["firstplayed"] == eachdate: - try: - if game["beat"] != eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) - except: - try: - if game["completed"] != eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) - except: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) - except: - pass - if game["initialdate"] == eachdate: - try: - if game["beat"] != eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Added"}) - except: - try: - if game["completed"] != eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Added"}) - except: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Added"}) try: if game["gameplay"] == eachdate: if game["firstplayed"] != eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Playing"}) - except: - pass - try: - if game["beaten"] == eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Beat"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Playing"}) except: pass try: if game["completed"] == eachdate: - yearlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Completed"}) + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Completed"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Completed"}) except: pass + try: + if game["beaten"] == eachdate: + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Beat"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Beat"}) + except: + pass + try: + if game["firstplayed"] == eachdate: + try: + if game["beaten"] != eachdate: + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + except: + try: + if game["completed"] != eachdate: + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + except: + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Started"}) + except: + pass + if game["initialdate"] == eachdate: + histlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Added"}) + feedlist.append({"date":eachdate,"name":game["name"],"console":game["console"],"action":"Added"}) eachdate -= timedelta(days=1) checkdate = enddate - for event in yearlist: + for event in histlist: filewrite.write("
\n") if checkdate != event["date"]: filewrite.write("

" + event["date"].strftime("%Y-%m-%d") + "

\n") @@ -1003,8 +1011,11 @@ def history(): else: filewrite.write("Started") else: - filewrite.write(event["action"]) + filewrite.write(event["action"]) filewrite.write("\">
\n
\n
" + event["name"] + "\n (" + event["console"] + ")\n
\n
\n
\n") + checkdate = event["date"] + checkdate = enddate + for event in feedlist: feedwrite.write(" \n " + event["action"] + " " + event["name"] + " (" + event["console"] + ")\n " + event["date"].strftime("%a, %-d %b %Y") + " 00:00:00 GMT\n https://tre.praze.net/trackers/games/history\n " + event["action"] + "-" + event["name"].replace(" ","-") + "-" + event["date"].strftime("%Y-%m-%d") + "\n " + event["action"] + " " + event["name"] + " (" + event["console"] + ")\n \n") checkdate = event["date"] theyear -= 1