X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=parse%2Fparse-ddreurope-tournament.pl;h=592a8e78b3656fb1169625285151440d4a5dbf5d;hb=e919c30db9bc56b9b56668892ec3247696095928;hp=6c42f5794eab8b366ca452ac38fdefaf38201b0e;hpb=c8ced6134e4cea84de6f8da5e6611a9ccce2b2dd;p=ccbs diff --git a/parse/parse-ddreurope-tournament.pl b/parse/parse-ddreurope-tournament.pl index 6c42f57..592a8e7 100644 --- a/parse/parse-ddreurope-tournament.pl +++ b/parse/parse-ddreurope-tournament.pl @@ -6,7 +6,7 @@ use Date::Manip; # Parses tournament results from the DDR Europe result list my $season = shift; -my ($name, $round, @rsongs); +my ($name, $round, $group, $player, $position, @rsongs); die "Missing season (give on command line)." if (!defined($season)); print "begin;\n"; @@ -24,18 +24,68 @@ while (<>) { /x) { my ($country, $location, $date, $mix, $system) = ($1, $2, $3, $4, $5); $mix =~ s/Euromix/EuroMix/; + $mix =~ s/Dance Dance Revolution 8th mix - Extreme/DDR Extreme/; + $system = '10K Machine score' if ($system =~ /^\s*$/); print "INSERT INTO tournaments \n"; - print " (season, name, country, location, \"date\", machine, scoringsystem) VALUES (\n"; - print " (SELECT season FROM seasons WHERE name='$season'),\n"; + print " (season, tournamentname, country, location, \"date\", machine, scoringsystem) VALUES (\n"; + print " (SELECT season FROM seasons WHERE seasonname='$season' AND season=( SELECT season FROM seasons WHERE seasonname='$season' )),\n"; print " '$name',\n"; - print " (SELECT country FROM countries WHERE name='$country'),\n"; + print " (SELECT country FROM countries WHERE countryname='$country'),\n"; print " '$location',\n"; printf " '%s',\n", Date::Manip::UnixDate($date, '%Y-%m-%d'); - print " (SELECT machine FROM machines WHERE name='$mix'),\n"; - print " (SELECT scoringsystem FROM scoringsystems WHERE name='$system')\n"; + print " (SELECT machine FROM machines WHERE machinename='$mix'),\n"; + print " (SELECT scoringsystem FROM scoringsystems WHERE scoringsystemname='$system')\n"; print ");\n"; } + + # Player's results (header) + if (/^