X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=parse%2Fparse-wiki-songlist.pl;h=4303c2d39bdf31a504e2e7f33f1935d4a7ee0d8c;hp=5a35d67a51fe69e711e7c038bbeb876b0a22ca5f;hb=09ae4d8636130d4c86ab3f8df8f823482f948f97;hpb=b9c9a6e34ae2018b9c26264c375a0c6ac8b02256 diff --git a/parse/parse-wiki-songlist.pl b/parse/parse-wiki-songlist.pl index 5a35d67..4303c2d 100644 --- a/parse/parse-wiki-songlist.pl +++ b/parse/parse-wiki-songlist.pl @@ -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]; } }