Automatically class portfolio decks as high priority

master
trémeur 1 month ago
parent a195e97f5c
commit b1f90124c6

@ -44,7 +44,4 @@ Python scripts to generate a mobile-friendly static site for tracking tcg cards
- For each transaction, add a dictionary ={}= to the =log= list like in the example (removing any of ="received"=, ="lost"=, ="crayons"=, ="decks"= that arent relevant).
- Run =./build.sh= in this directory to download the relevant card images and then upload everything to the server.
** Currently unaccounted for
- Duplicates (should be fine but not checked)
- Coupons
- Card search
- Date to level needs redone

@ -72,6 +72,14 @@ def collecting(deck):
if deck in variables.highpriority:
return True
else:
portfoliocollecting = False
for event in log.log:
if portfoliocollecting == False:
if event["event"] == "portfolio":
if deck in event["decks"]:
portfoliocollecting = True
return True
if portfoliocollecting == False:
if deck in medium:
return True
else:
@ -86,14 +94,20 @@ def priority(deck):
if collecting(deck):
if deck in variables.highpriority:
return "high"
else:
if len(deckcards(deck)) >= variables.highthreshold:
elif len(deckcards(deck)) >= variables.highthreshold:
return "high"
else:
portfoliopriority = False
for event in log.log:
if portfoliopriority == False:
if event["event"] == "portfolio":
if deck in event["decks"]:
portfoliopriority = True
return "high"
if portfoliopriority == False:
if deck in medium:
return "medium"
else:
if len(deckcards(deck)) >= variables.mediumthreshold:
elif len(deckcards(deck)) >= variables.mediumthreshold:
return "medium"
else:
return ("low")

Loading…
Cancel
Save