kino/app/Main.hs

23 lines
399 B
Haskell
Raw Normal View History

2021-09-05 19:30:29 +02:00
module Main where
2021-09-14 17:06:34 +02:00
import qualified Data.Text as T
2021-09-06 21:02:39 +02:00
import qualified JSONTypes as J
2021-09-14 17:06:34 +02:00
import Request
2021-09-06 21:02:39 +02:00
import Torrent
2021-09-14 17:06:34 +02:00
import UI
2021-09-06 21:02:39 +02:00
import System.Environment
2021-09-05 19:30:29 +02:00
main :: IO ()
2021-09-06 21:02:39 +02:00
main = do
args <- getArgs
case args of
2021-09-14 17:06:34 +02:00
([]) -> runApp >> pure ()
(x:_) -> do
2021-09-06 21:02:39 +02:00
movies <- queryMovies (T.pack x)
case movies of
(Left m) -> print m
(Right d) -> mapM_ printMagnets (J.movies d)