From 58bb9d54d0d8b31bef6c855ba4c6048b3cdc3f72 Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Wed, 4 Feb 2015 21:25:06 +0530
Subject: [PATCH] WIP: info record

---
 src/Metainfo.hs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/Metainfo.hs b/src/Metainfo.hs
index 4522863..58a2369 100644
--- a/src/Metainfo.hs
+++ b/src/Metainfo.hs
@@ -1,9 +1,19 @@
 module Metainfo where
 
 import qualified Bencode as Benc
+import qualified Data.ByteString.Char8 as BC
 import Data.Time.Clock
 
-data Metainfo = MetaInfo { info :: Benc.BVal
+-- only single file mode supported for the time being.
+data Info = Info { pieceLength :: Integer
+                 , pieces :: BC.ByteString
+                 , private :: Maybe Integer
+                 , name :: String
+                 , lengthInBytes :: Integer
+                 , md5sum :: Maybe String }
+          deriving (Eq)
+
+data Metainfo = MetaInfo { info :: Info
                          , announce :: String
                          , announceList :: Maybe [[String]]
                          , creationDate :: Maybe UTCTime
-- 
2.45.2