1 import System
.IO
(readFile
, FilePath
(..))
2 import System
.Environment
(getArgs
)
13 , directors ::
[String
]
15 , countries ::
[String
]
17 , userRating :: Maybe Int
18 , pressRating :: Maybe Int
22 , budgetUnit :: String
28 , moviesDir :: FilePath
34 Left mess
-> print mess
36 paths
<- moviePaths
$ moviesDir args
37 file
<- readFile
"../xml/test.xml"
38 print
$ parseXMLDoc file
40 movieExtenstions
= ["avi", "mkv", "rmvb", "ogm", "divx"]
42 readArgs ::
[String
] -> Either String Args
43 readArgs plop
= undefined
44 {--readArgs (name:value:rest) = case name of
45 "-x" -> { xml = value }
46 "-d" -> { moviesDir = value }--}
48 moviePaths :: FilePath -> IO [FilePath]
49 moviePaths dir = undefined
51 readXMLFile :: FilePath -> IO Movies
52 readXMLFile file = undefined
56 writeXMLFile :: Movies -> FilePath -> IO ()
57 writeXMLFile movies file = undefined
59 filesPath :: FilePath -> IO [FilePath]
60 filesPath basePath = undefined
62 movieName :: FilePath -> String
65 -- Int is the module id.
66 data SearchResult = OK (Int, Movie)
67 | Many [(Int, String)] -- String is the name of the movie.
70 data Module = Module {
71 search :: String -> IO SearchResult
72 -- Int is the module id. FilePath is a path to the image like "../img/4353"
73 , downloadImage :: Int -> FilePath
77 Gets a movie by asking the given module to find a movie.
78 A movie is seeked by its the filename.
79 If there is many possibilities then it will ask the user.
81 searchAMovie :: String
-> Module
-> IO SearchResult
82 searchAMovie filename mod
= undefined