# Parses songlist from the DDRNO wiki
+print "begin;\n";
+
while (<>) {
m/
\| \s* \[\[ (.*?) \]\] \s* # song name
$artist =~ s/\[\[//g;
# minimal SQL escaping
- $songname =~ s/'/\'/g;
- $artist =~ s/'/\'/g;
+ $songname =~ s/'/\\'/g;
+ $artist =~ s/'/\\'/g;
$maxbpm = $minbpm if (!defined($maxbpm));
($maxbpm,$minbpm) = ($minbpm,$maxbpm) if ($maxbpm < $minbpm);
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 "commit;\n";