]> git.sesse.net Git - ccbs/blobdiff - parse/parse-wiki-songlist.pl
Update the wiki parser and the EM2 SQL to match the new feet rating data.
[ccbs] / parse / parse-wiki-songlist.pl
index 5a35d67a51fe69e711e7c038bbeb876b0a22ca5f..4303c2d39bdf31a504e2e7f33f1935d4a7ee0d8c 100644 (file)
@@ -2,6 +2,9 @@
 use strict;
 use warnings;
 
+my $machine = shift;
+die "Missing machine (first argument on the command line)" if (!defined($machine));
+
 # Parses songlist from the DDRNO wiki
 
 print "begin;\n";
@@ -45,8 +48,8 @@ while (<>) {
                    ['double', 'standard', $ds],
                    ['double', 'difficult', $dd],
                    ['double', 'expert', $de]) {
-               printf "INSERT INTO songratings (song,playmode,difficulty,feetrating) VALUES ((SELECT song FROM songs WHERE title='%s'),'%s','%s',%u);\n",
-                       $songname, $t->[0], $t->[1], $t->[2];
+               printf "INSERT INTO songratings (song,machine,playmode,difficulty,feetrating) VALUES ((SELECT song FROM songs WHERE title='%s'),(SELECT machine FROM machines WHERE machinename='%s'),'%s','%s',%u);\n",
+                       $songname, $machine, $t->[0], $t->[1], $t->[2];
        }
 }