top shouts wtih rating and views
This commit is contained in:
@@ -89,6 +89,7 @@ class TopShouts:
|
|||||||
for row in session.execute(stmt):
|
for row in session.execute(stmt):
|
||||||
shout = row.Shout
|
shout = row.Shout
|
||||||
shout.rating = row.rating
|
shout.rating = row.rating
|
||||||
|
shout.views = await ShoutViewStorage.get_view(shout.id)
|
||||||
shouts.append(shout)
|
shouts.append(shout)
|
||||||
async with TopShouts.lock:
|
async with TopShouts.lock:
|
||||||
TopShouts.shouts_by_rating = shouts
|
TopShouts.shouts_by_rating = shouts
|
||||||
@@ -121,6 +122,7 @@ class TopShouts:
|
|||||||
for row in session.execute(stmt):
|
for row in session.execute(stmt):
|
||||||
shout = row.Shout
|
shout = row.Shout
|
||||||
shout.rating = row.rating
|
shout.rating = row.rating
|
||||||
|
shout.views = await ShoutViewStorage.get_view(shout.id)
|
||||||
shouts.append(shout)
|
shouts.append(shout)
|
||||||
async with TopShouts.lock:
|
async with TopShouts.lock:
|
||||||
TopShouts.favorite_shouts = shouts
|
TopShouts.favorite_shouts = shouts
|
||||||
@@ -138,6 +140,7 @@ class TopShouts:
|
|||||||
shouts = []
|
shouts = []
|
||||||
for row in session.execute(stmt):
|
for row in session.execute(stmt):
|
||||||
shout = row.Shout
|
shout = row.Shout
|
||||||
|
shout.rating = await ShoutRatingStorage.get_rating(shout.id)
|
||||||
shout.view = row.view
|
shout.view = row.view
|
||||||
shouts.append(shout)
|
shouts.append(shout)
|
||||||
async with TopShouts.lock:
|
async with TopShouts.lock:
|
||||||
|
|||||||
Reference in New Issue
Block a user