]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blobdiff - src/TSN/XML/EarlyLine.hs
Fix present-but-empty vleague parsing in jfilexml.
[dead/htsn-import.git] / src / TSN / XML / EarlyLine.hs
index 5ec81a37e14bb18a6f197ab1f68a4d134e1a8649..fe11b980f5503a9a0bf5373fe04ec2638b3721a9 100644 (file)
@@ -42,11 +42,9 @@ import Database.Groundhog (
   countAll,
   deleteAll,
   insert_,
-  migrate,
-  runMigration,
-  silentMigrationLogger )
+  migrate )
 import Database.Groundhog.Core ( DefaultKey )
-import Database.Groundhog.Generic ( runDbConn )
+import Database.Groundhog.Generic ( runDbConn, runMigrationSilent )
 import Database.Groundhog.Sqlite ( withSqliteConn )
 import Database.Groundhog.TH (
   groundhog,
@@ -69,10 +67,12 @@ import Text.XML.HXT.Core (
   xpWrap )
 
 -- Local imports.
+import Misc ( double_just )
 import TSN.Codegen ( tsn_codegen_config )
 import TSN.DbImport ( DbImport(..), ImportResult(..), run_dbmigrate )
 import TSN.Picklers (
   xp_ambiguous_time,
+  xp_attr_option,
   xp_early_line_date,
   xp_time_stamp )
 import TSN.XmlImport ( XmlImport(..) )
@@ -561,7 +561,7 @@ pickle_home_team = xpElem "teamH" pickle_team
 pickle_team :: PU EarlyLineGameTeamXml
 pickle_team =
   xpWrap (from_tuple, to_tuple') $
-  xp6Tuple (xpAttr "rotation" (xpOption xpInt))
+  xp6Tuple (xpAttr "rotation" xp_attr_option)
            (xpOption $ xpAttr "line" (xpOption xpText))
            (xpOption $ xpAttr "name" xpText)
            (xpOption xpText)
@@ -573,10 +573,6 @@ pickle_team =
 
     to_tuple' (EarlyLineGameTeamXml u v w x y z) =
       (u, double_just v, w, x, double_just y, double_just z)
-      where
-        double_just val = case val of
-               Nothing -> Nothing
-               just_something -> Just just_something
 
 
 
@@ -647,7 +643,7 @@ test_on_delete_cascade = testGroup "cascading delete tests"
       let b = undefined :: EarlyLineGame
 
       actual <- withSqliteConn ":memory:" $ runDbConn $ do
-                  runMigration silentMigrationLogger $ do
+                  runMigrationSilent $ do
                     migrate a
                     migrate b
                   _ <- dbimport results