topPublished
This commit is contained in:
@@ -248,6 +248,15 @@ class ShoutsCache:
|
||||
print("[zine.cache] indexed by %d authors " % len(shouts_by_author.keys()))
|
||||
ShoutsCache.by_author = shouts_by_author
|
||||
|
||||
@staticmethod
|
||||
async def get_top_published_before(daysago, offset, limit):
|
||||
shouts_by_rating = []
|
||||
before = datetime.now() - timedelta(days=daysago)
|
||||
for s in ShoutsCache.recent_published:
|
||||
if s.publishedAt >= before:
|
||||
shouts_by_rating.append(s)
|
||||
return shouts_by_rating
|
||||
|
||||
@staticmethod
|
||||
async def prepare_by_topic():
|
||||
shouts_by_topic = {}
|
||||
|
Reference in New Issue
Block a user