File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,9 +155,9 @@ async function calculateRanks() {
155155 }
156156
157157 const sortedByRating = combinedStats
158- . filter ( s => s . user . cfRating !== null )
159- . sort ( ( a , b ) => b . user . cfRating ! - a . user . cfRating ! ) ;
160-
158+ . filter ( s => s . finalRating !== null || s . finalRating !== 0 )
159+ . sort ( ( a , b ) => ( b . finalRating ?? 0 ) - ( a . finalRating ?? 0 ) ) ;
160+
161161 const rankUpdates = sortedByRating . map ( ( stat , i ) =>
162162 db . update ( wrapped25 ) . set ( { campusRank : i + 1 } ) . where ( eq ( wrapped25 . id , stat . id ) )
163163 ) ;
@@ -178,8 +178,8 @@ async function calculateRanks() {
178178 const batchRankUpdates = [ ] ;
179179 for ( const batch in batches ) {
180180 const sortedBatch = batches [ batch ]
181- . filter ( s => s . user . cfRating !== null )
182- . sort ( ( a , b ) => b . user . cfRating ! - a . user . cfRating ! ) ;
181+ . filter ( s => s . finalRating !== null && s . finalRating !== 0 )
182+ . sort ( ( a , b ) => ( b . finalRating ?? 0 ) - ( a . finalRating ?? 0 ) ) ;
183183
184184 for ( let i = 0 ; i < sortedBatch . length ; i ++ ) {
185185 const stat = sortedBatch [ i ] ;
You can’t perform that action at this time.
0 commit comments