forked from MarseyWorld/MarseyWorld
reduce query volume, badge edition
parent
74978bfbf7
commit
e36adb5bf4
|
@ -233,8 +233,10 @@ class User(Base):
|
|||
elif self.patron == 7: discount = 0.60
|
||||
else: discount = 1
|
||||
|
||||
owned_badges = [x.badge_id for x in self.badges]
|
||||
|
||||
for badge in discounts:
|
||||
if self.has_badge(badge): discount -= discounts[badge]
|
||||
if badge in owned_badges: discount -= discounts[badge]
|
||||
|
||||
return discount
|
||||
|
||||
|
|
|
@ -30,14 +30,6 @@ if path.exists(f'snappy_{SITE_NAME}.txt'):
|
|||
with open(f'snappy_{SITE_NAME}.txt', "r", encoding="utf-8") as f:
|
||||
snappyquotes += f.read().split("\n{[para]}\n")
|
||||
|
||||
discounts = {
|
||||
69: 0.02,
|
||||
70: 0.04,
|
||||
71: 0.06,
|
||||
72: 0.08,
|
||||
73: 0.10,
|
||||
}
|
||||
|
||||
titleheaders = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue