X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=parse%2Fparse-ddrfreak-songlist.pl;fp=parse%2Fparse-ddrfreak-songlist.pl;h=c2fc231d05fc324368bbf6f73ad3a9e7b2ee7eb5;hp=a880275b6f13a9022ebaba1b2568d0a005709580;hb=08596cd49fe5137da3e1a1a72b68a1311f85ff2d;hpb=bc0f08751879982abbfe095e0994547fa25f1b16 diff --git a/parse/parse-ddrfreak-songlist.pl b/parse/parse-ddrfreak-songlist.pl index a880275..c2fc231 100644 --- a/parse/parse-ddrfreak-songlist.pl +++ b/parse/parse-ddrfreak-songlist.pl @@ -90,9 +90,9 @@ while (<>) { $artist =~ s/'/\\'/g; # Insert the song only if it doesn't already exist - printf "INSERT INTO songs SELECT nextval('songs_song_seq') AS song, '%s' AS title, '%s' AS artist, 0 AS minbpm, 0 AS maxbpm WHERE '%s' NOT IN ( SELECT title FROM songs );\n", + printf "INSERT INTO songs SELECT nextval('songs_song_seq') AS song, '%s' AS title, '%s' AS artist, 0 AS minbpm, 0 AS maxbpm WHERE LOWER('%s') NOT IN ( SELECT LOWER(title) FROM songs );\n", $songname, $artist, $songname; - printf "INSERT INTO machinesongs SELECT ( SELECT song FROM songs WHERE title='%s' ), ( SELECT machine FROM machines WHERE machinename='%s' );\n", + printf "INSERT INTO machinesongs SELECT ( SELECT song FROM songs WHERE LOWER(title)=LOWER('%s') ), ( SELECT machine FROM machines WHERE machinename='%s' );\n", $songname, $machine; for my $t (['single', 'beginner', $sb], @@ -105,7 +105,7 @@ while (<>) { ['double', 'expert', $de], ['double', 'challenge', $dc]) { next if (!defined($t->[2]) || $t->[2] eq ''); - 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", + printf "INSERT INTO songratings (song,machine,playmode,difficulty,feetrating) VALUES ((SELECT song FROM songs WHERE LOWER(title)=LOWER('%s')),(SELECT machine FROM machines WHERE machinename='%s'),'%s','%s',%u);\n", $songname, $machine, $t->[0], $t->[1], $t->[2]; } }