rand
This commit is contained in:
parent
77764bf902
commit
205e95f36b
2 changed files with 4 additions and 4 deletions
|
@ -353,10 +353,10 @@ class Comment(Base):
|
||||||
|
|
||||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
||||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||||
maxupvotes = min(ti, 6)
|
maxupvotes = min(ti, 13)
|
||||||
rand = randint(0, maxupvotes)
|
rand = randint(0, maxupvotes)
|
||||||
if self.upvotes < rand:
|
if self.upvotes < rand:
|
||||||
amount = randint(0, 1)
|
amount = randint(0, 3)
|
||||||
if amount == 1:
|
if amount == 1:
|
||||||
self.upvotes += amount
|
self.upvotes += amount
|
||||||
g.db.add(self)
|
g.db.add(self)
|
||||||
|
|
|
@ -376,10 +376,10 @@ class Submission(Base):
|
||||||
|
|
||||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
||||||
ti = max(int((time.time() - self.created_utc)/60), 1)
|
ti = max(int((time.time() - self.created_utc)/60), 1)
|
||||||
maxupvotes = min(ti, 7)
|
maxupvotes = min(ti, 11)
|
||||||
rand = random.randint(0, maxupvotes)
|
rand = random.randint(0, maxupvotes)
|
||||||
if self.upvotes < rand:
|
if self.upvotes < rand:
|
||||||
amount = random.randint(0, 1)
|
amount = random.randint(0, 3)
|
||||||
if amount == 1:
|
if amount == 1:
|
||||||
self.views += amount*random.randint(3, 5)
|
self.views += amount*random.randint(3, 5)
|
||||||
self.upvotes += amount
|
self.upvotes += amount
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue