@@ -108,6 +108,7 @@ document.directory.nextBoards = [];
108
108
109
109
function prepareDirectory ( boards ) {
110
110
$ ( "#games-container" ) . empty ( ) ;
111
+ displayGame ( [ '' , '' , '' , 'Loading Games...' , 'This may take a second.' , '' , '' , '' , '' , '' , '' , '' , '' , '' ] , null ) ;
111
112
if ( boards . length > 60 ) {
112
113
document . directory . upToDate = false ;
113
114
localDirectory . transpositions = [ ] ;
@@ -352,23 +353,24 @@ function gamesObserver(count) {
352
353
353
354
function pullGames ( requests , database ) {
354
355
const criteria = [ $ ( "#Sort" ) . val ( ) . slice ( 0 , - 3 ) , $ ( "#Sort" ) . val ( ) . slice ( - 3 ) ] ;
356
+ const collection = $ ( "#collection" ) . val ( ) ;
355
357
document . directory . search . temp = [ ] ;
356
358
$ . each ( requests , ( i , r ) => {
357
359
let location ;
358
360
if ( r [ 0 ] == 5000 )
359
361
location = `${ prefix } ${ database } /chunks/${ zfill ( r [ 1 ] ) } .csv` ;
360
362
else
361
363
location = `${ prefix } ${ database } /sorted/${ criteria [ 0 ] } /${ criteria [ 1 ] } /${ r [ 0 ] } /${ zfill ( r [ 1 ] ) } .csv` ;
362
- games = document . directory . search . cache [ r . toString ( ) ]
364
+ games = document . directory . search . cache [ r . toString ( ) + criteria . toString ( ) + ',' + collection ] ;
363
365
if ( games ) {
364
366
document . directory . search . temp . push ( games ) ;
365
- console . log ( `cache hit ${ location } ` )
367
+ console . log ( `cache hit ${ r . toString ( ) + criteria . toString ( ) + ',' + collection } ` )
366
368
return ;
367
369
} else {
368
370
$ . when ( $ . get ( location ) ) . done ( games => {
369
- console . log ( `cache miss ${ location } ` )
371
+ console . log ( `cache miss ${ r . toString ( ) + criteria . toString ( ) + ',' + collection } ` )
370
372
const arr = $ . csv . toArrays ( games ) . slice ( 1 , - 1 ) ;
371
- document . directory . search . cache [ r . toString ( ) ] = arr ;
373
+ document . directory . search . cache [ r . toString ( ) + criteria . toString ( ) + ',' + collection ] = arr ;
372
374
document . directory . search . temp . push ( arr ) ;
373
375
} ) ;
374
376
}
0 commit comments