Few Corrections to the Start Algorithm

This commit is contained in:
Jeison Yehuda Amihud (Blender Dumbass) 2023-02-05 03:53:09 +00:00
parent 8c623171a0
commit 7d8a433d97

View file

@ -829,13 +829,18 @@ def load(project_location):
# Needed # Needed
try: try:
data["needed"] = ( 1 - data["fraction"] ) / ( data["duration"] - data["dayspassed"] ) alldates = list(reversed(data["dates"].keys()))
prevdate = alldates[alldates.index(today)+1]
prev_frac = data["dates"][prevdate].get("fractions", {}).get("project", data["fraction"])
data["needed"] = ( 1 - prev_frac ) / ( data["duration"] - data["dayspassed"] )
except: except:
data["needed"] = 0 data["needed"] = 0
prev_star = data.get("star", 0) prev_star = data.get("star", 0)
try: try:
prev_frac = data["dates"][list(reversed(data["dates"].keys()))[1]].get("fractions", {}).get("project", data["fraction"]) alldates = list(reversed(data["dates"].keys()))
prevdate = alldates[alldates.index(today)+1]
prev_frac = data["dates"][prevdate].get("fractions", {}).get("project", data["fraction"])
data["star"] = (data["fraction"] - prev_frac) / data["needed"] data["star"] = (data["fraction"] - prev_frac) / data["needed"]
except: except:
data["star"] = 0 data["star"] = 0