last-ditch attempt, killing myself if this one fails
parent
12ceae5677
commit
ba144f026e
|
@ -141,21 +141,10 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if v: size = v.frontsize or 0
|
if v: size = v.frontsize or 0
|
||||||
else: size = PAGE_SIZE
|
else: size = PAGE_SIZE
|
||||||
|
|
||||||
if SITE_NAME == 'WPD' and sort == "hot":
|
if True and sort == "hot":
|
||||||
posts = posts.offset(size * (page - 1)).limit(100).all()
|
posts = posts.offset(size * (page - 1)).limit(100).all()
|
||||||
social_found = False
|
to_remove = [x.id for x in posts if x.sub == 'social'][1:] + [x.id for x in posts if x.sub == 'music'][1:]
|
||||||
music_found = False
|
posts = [x for x in posts if x.id not in to_remove]
|
||||||
for post in posts:
|
|
||||||
if v and v.id == AEVANN_ID: print(post.sub, flush=True)
|
|
||||||
if post.sub == 'social':
|
|
||||||
if v and v.id == AEVANN_ID:
|
|
||||||
print(post.id, flush=True)
|
|
||||||
print(social_found, flush=True)
|
|
||||||
if social_found: posts.remove(post)
|
|
||||||
else: social_found = True
|
|
||||||
elif post.sub == 'music':
|
|
||||||
if music_found: posts.remove(post)
|
|
||||||
else: music_found = True
|
|
||||||
else:
|
else:
|
||||||
posts = posts.offset(size * (page - 1)).limit(size+1).all()
|
posts = posts.offset(size * (page - 1)).limit(size+1).all()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue