Skip to content

Commit

Permalink
make it so /all?short=block will only shorten blocks, not allows
Browse files Browse the repository at this point in the history
  • Loading branch information
Humbedooh committed Aug 16, 2021
1 parent 1fd8eb9 commit d040488
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion endpoints/all.py
Expand Up @@ -29,8 +29,9 @@ async def process(state: plugins.configuration.BlockyConfiguration, request, for
total_blocks = len(block_items)
total_allows = len(allow_items)
if short: # For not showing all 27482487 items, for front page
allow_items = sorted(allow_items, reverse=True, key=operator.itemgetter("timestamp"))[:25]
block_items = sorted(block_items, reverse=True, key=operator.itemgetter("timestamp"))[:25]
if short != "block":
allow_items = sorted(allow_items, reverse=True, key=operator.itemgetter("timestamp"))[:25]
return {
"total_block": total_blocks,
"total_allow": total_allows,
Expand Down

0 comments on commit d040488

Please sign in to comment.