]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/Odds.hs
Make the Odds team rotation numbers optional.
[dead/htsn-import.git] / src / TSN / XML / Odds.hs
index 4ca64754a41eac1e320a5e45eea569f7dee40c03..934c3d340508f89a3d0c40b770ce49c3fd9e975d 100644 (file)
@@ -166,7 +166,7 @@ data OddsGameHomeTeamXml =
                                         --   so we ignore the probable
                                         --   upper bound of three
                                         --   characters.
-    xml_home_team_rotation_number :: Int,
+    xml_home_team_rotation_number :: Maybe Int,
     xml_home_team_abbr            :: String,
     xml_home_team_name            :: String,
     xml_home_team_starter         :: Maybe (Int, String), -- ^ (id, name)
@@ -209,7 +209,7 @@ data OddsGameAwayTeamXml =
                                         --   on lengthless text fields, so
                                         --   we ignore the probable upper
                                         --   bound of three characters
-    xml_away_team_rotation_number :: Int,
+    xml_away_team_rotation_number :: Maybe Int,
     xml_away_team_abbr            :: String,
     xml_away_team_name            :: String,
     xml_away_team_starter         :: Maybe (Int, String), -- ^ (id, name)
@@ -284,8 +284,8 @@ data OddsGame =
     db_home_team_id      :: DefaultKey Team,
     db_game_id           :: Int,
     db_game_time         :: UTCTime, -- ^ Contains both the date and time.
-    db_away_team_rotation_number :: Int,
-    db_home_team_rotation_number :: Int,
+    db_away_team_rotation_number :: Maybe Int,
+    db_home_team_rotation_number :: Maybe Int,
     db_away_team_starter_id :: Maybe Int,
     db_away_team_starter_name :: Maybe String,
     db_home_team_starter_id :: Maybe Int,
@@ -619,7 +619,7 @@ pickle_home_team =
     xpWrap (from_tuple, to_tuple) $
       xp6Tuple
         (xpElem "HomeTeamID" xpText)
-        (xpElem "HomeRotationNumber" xpInt)
+        (xpElem "HomeRotationNumber" (xpOption xpInt))
         (xpElem "HomeAbbr" xpText)
         (xpElem "HomeTeamName" xpText)
         (-- This is an ugly way to get both the HStarter ID attribute
@@ -645,7 +645,7 @@ pickle_away_team =
     xpWrap (from_tuple, to_tuple) $
       xp6Tuple
         (xpElem "AwayTeamID" xpText)
-        (xpElem "AwayRotationNumber" xpInt)
+        (xpElem "AwayRotationNumber" (xpOption xpInt))
         (xpElem "AwayAbbr" xpText)
         (xpElem "AwayTeamName" xpText)
         (-- This is an ugly way to get both the AStarter ID attribute