Use a cached song hashmap because otherwise it takes too long
authorCameron Ball <cameron@cameron1729.xyz>
Sat, 4 May 2019 10:52:23 +0000 (18:52 +0800)
committerCameron Ball <cameron@cameron1729.xyz>
Sat, 4 May 2019 10:52:23 +0000 (18:52 +0800)
src/gnb.php

index c8c32fb..8160750 100644 (file)
@@ -35,11 +35,7 @@ getTelegram()->addCommand(
                 'Edit' => '📓'
             ];
 
-            //WOAH NELLY!
-            ini_set('max_execution_time', '300'); //300 seconds = 5 minutes
-            $songHashMap = foldMap(
-                ☐(∘(field(0), delemit(' ')))(∘(field(5), delemit('/')))
-            )(foldMap(∘(lines, 'trim', 'file_get_contents'))(glob(PATH_TO_GROOVENET . '/songs.*.txt')));
+            $songHashMap = unserialize(file_get_contents(__DIR__ . '/hashmap.txt'));
 
             $scoreFiles = foldMap(∘(☐(lhead)(null), 'file_get_contents'))(glob(PATH_TO_GROOVENET . '/*.scores.txt'));
             $scoreTesseract = map(map(map(maxKey)))(