X-Git-Url: http://gitweb.michael.orlitzky.com/?p=dead%2Fhtsn-import.git;a=blobdiff_plain;f=src%2FTSN%2FXML%2FScores.hs;fp=src%2FTSN%2FXML%2FScores.hs;h=f7a03a61bac53376b69055258739cf333a0739db;hp=858e62bc1a6d53ca50301e21de5e120eb4d561bb;hb=fdd85d5ed7944e6a6373c99c2e341f370cd931f8;hpb=073bbfba4165d4c01d29daaa7523c35c6cc7d114 diff --git a/src/TSN/XML/Scores.hs b/src/TSN/XML/Scores.hs index 858e62b..f7a03a6 100644 --- a/src/TSN/XML/Scores.hs +++ b/src/TSN/XML/Scores.hs @@ -57,6 +57,7 @@ import Text.XML.HXT.Core ( xpWrap ) -- Local imports. +import Misc ( double_just ) import TSN.Codegen ( tsn_codegen_config ) import TSN.Database ( insert_or_select ) import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate ) @@ -450,11 +451,7 @@ pickle_status = where from_tuple (x,y,z) = ScoreGameStatus x (join y) z to_tuple' ScoreGameStatus{..} = - (db_status_numeral, s, db_status_text) - where - s = case db_status_type of - Nothing -> Nothing - Just _ -> Just db_status_type + (db_status_numeral, double_just db_status_type, db_status_text) -- | Convert a 'ScoreGameXml' to/from \. @@ -522,8 +519,7 @@ pickle_hteam = (xpOption xpText) -- Team name where from_tuple (x,y,z)= HTeamXml (HTeam (Team x Nothing z)) (join y) - to_tuple' (HTeamXml (HTeam t) Nothing) = (team_id t, Nothing, name t) - to_tuple' (HTeamXml (HTeam t) jhp) = (team_id t, Just jhp, name t) + to_tuple' (HTeamXml (HTeam t) jhp) = (team_id t, double_just jhp, name t)