Only compute the selected index order.
This commit is contained in:
parent
d5320c4aa1
commit
f186044a4f
@ -595,18 +595,17 @@ Index =
|
|||||||
|
|
||||||
sort: ->
|
sort: ->
|
||||||
{liveThreadIDs, liveThreadData} = Index
|
{liveThreadIDs, liveThreadData} = Index
|
||||||
sortedThreadIDs = {
|
sortedThreadIDs = switch Conf['Index Sort']
|
||||||
lastreply:
|
when 'lastreply'
|
||||||
[liveThreadData...].sort((a, b) ->
|
[liveThreadData...].sort((a, b) ->
|
||||||
a = num[num.length - 1] if (num = a.last_replies)
|
a = num[num.length - 1] if (num = a.last_replies)
|
||||||
b = num[num.length - 1] if (num = b.last_replies)
|
b = num[num.length - 1] if (num = b.last_replies)
|
||||||
b.no - a.no
|
b.no - a.no
|
||||||
).map (post) -> post.no
|
).map (post) -> post.no
|
||||||
bump: liveThreadIDs
|
when 'bump' then liveThreadIDs
|
||||||
birth: [liveThreadIDs... ].sort (a, b) -> b - a
|
when 'birth' then [liveThreadIDs... ].sort (a, b) -> b - a
|
||||||
replycount: [liveThreadData...].sort((a, b) -> b.replies - a.replies).map (post) -> post.no
|
when 'replycount' then [liveThreadData...].sort((a, b) -> b.replies - a.replies).map (post) -> post.no
|
||||||
filecount: [liveThreadData...].sort((a, b) -> b.images - a.images ).map (post) -> post.no
|
when 'filecount' then [liveThreadData...].sort((a, b) -> b.images - a.images ).map (post) -> post.no
|
||||||
}[Conf['Index Sort']]
|
|
||||||
Index.sortedNodes = sortedNodes = []
|
Index.sortedNodes = sortedNodes = []
|
||||||
{nodes} = Index
|
{nodes} = Index
|
||||||
for threadID in sortedThreadIDs
|
for threadID in sortedThreadIDs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user