]> gitweb.michael.orlitzky.com - dead/htsn-import.git/commitdiff
Enable import of AutoRacingResults in Main.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 12 Jun 2014 21:25:18 +0000 (17:25 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 12 Jun 2014 21:25:18 +0000 (17:25 -0400)
src/Main.hs

index d5f6612611a29f090411e47e1815860f9417dd23..0b6dce631166ef83c06d8be345810e0277893d57 100644 (file)
@@ -46,7 +46,8 @@ import Network.Services.TSN.Report (
   report_error )
 import TSN.DbImport ( DbImport(..), ImportResult(..) )
 import qualified TSN.XML.AutoRacingResults as AutoRacingResults (
-  dtd )
+  dtd,
+  pickle_message )
 import qualified TSN.XML.AutoRacingSchedule as AutoRacingSchedule (
   dtd,
   pickle_message )
@@ -163,7 +164,9 @@ import_file cfg path = do
           migrate_and_import m = dbmigrate m >> dbimport m
 
           importer
-            | dtd == AutoRacingResults.dtd = undefined
+            | dtd == AutoRacingResults.dtd = do
+               let m = unpickleDoc AutoRacingResults.pickle_message xml
+               maybe (return $ ImportFailed errmsg) migrate_and_import m
 
             | dtd == AutoRacingSchedule.dtd = do
                let m = unpickleDoc AutoRacingSchedule.pickle_message xml