Prepare for adding other trackers

This commit is contained in:
mez 2024-06-19 15:52:15 +01:00
parent 6a8a0c40e6
commit 29ab288b65
29 changed files with 224 additions and 201 deletions

View file

@ -15,27 +15,27 @@ def playcard(game,local=False,decay=False):
if game["console"] == console["code"]:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += console["img"] + ".png\" title=\"" + console["name"] + "\" alt=\"" + console["shortname"] + "\" class=\"bw\">\n"
cardstring += " </div>\n </div>\n <div class=\"status\">\n"
try:
if game["completed"]:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "C.png\" alt=\"C\" title=\"Completed\">\n"
except:
try:
if game["beaten"]:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "B.png\" alt=\"B\" title=\"Beaten\">\n"
except:
try:
@ -43,23 +43,23 @@ def playcard(game,local=False,decay=False):
if game["id"] in variables.endlessgames:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "E.png\" alt=\"E\" title=\"Endless\">\n"
else:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "UF.png\" alt=\"UF\" title=\"Unfinished\">\n"
except:
cardstring += " <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "UP.png\" alt=\"UP\" title=\"Unplayed\">\n"
cardstring += " </div>\n <div class=\"text\">\n <div class=\"title\">" + game["name"] + "</div>\n"
try:
@ -77,9 +77,9 @@ def playcard(game,local=False,decay=False):
else:
cardstring += " </div>\n <div class=\"priority\">\n <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "nowplaying.png\" alt=\"\" title=\"Now Playing\">\n </div>\n"
else:
cardstring += " </div>\n <div class=\"priority\">\n <span title=\"Normal\"/>\n </div>\n"
@ -92,9 +92,9 @@ def playcard(game,local=False,decay=False):
else:
cardstring += " </div>\n <div class=\"priority\">\n <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "nowplaying.png\" alt=\"\" title=\"Now Playing\">\n </div>\n"
else:
cardstring += " </div>\n <div class=\"priority\">\n <span title=\"Normal\"/>\n </div>\n"
@ -105,16 +105,16 @@ def playcard(game,local=False,decay=False):
else:
cardstring += " </div>\n <div class=\"priority\">\n <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "paused.png\" alt=\"\" title=\"Paused\">\n </div>\n"
else:
cardstring += " </div>\n <div class=\"priority\">\n <img src=\""
if local:
cardstring += variables.localpath + "build/"
cardstring += variables.localpath + "gamebuild/"
else:
cardstring += variables.serverpath
cardstring += variables.gameserverpath
cardstring += "nowplaying.png\" alt=\"\" title=\"Now Playing\">\n </div>\n"
except:
cardstring += " </div>\n <div class=\"priority\">\n <span title=\"Normal\"/>\n </div>\n"