From: Michael Orlitzky Date: Thu, 12 Jun 2014 21:25:18 +0000 (-0400) Subject: Enable import of AutoRacingResults in Main. X-Git-Tag: 0.0.6~215 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=f03c6dfde16ef07651b20354ed60996c4103e9d5;p=dead%2Fhtsn-import.git Enable import of AutoRacingResults in Main. --- diff --git a/src/Main.hs b/src/Main.hs index d5f6612..0b6dce6 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -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