pgdl 9.0 → 9.1
raw patch · 3 files changed
+7/−6 lines, 3 filesdep ~directory
Dependency ranges changed: directory
Files
- pgdl.cabal +2/−2
- src/Configure.hs +2/−1
- src/Networking.hs +3/−3
pgdl.cabal view
@@ -1,6 +1,6 @@ name: pgdl-version: 9.0+version: 9.1 license: PublicDomain license-file: LICENSE author: mingchuan@@ -38,7 +38,7 @@ conduit, conduit-extra, http-conduit, resourcet, configurator >= 0.3,- directory >= 1.2.3.0,+ directory, Cabal, filepath, transformers,
src/Configure.hs view
@@ -59,7 +59,8 @@ -- if it doesn't exists. getCacheFileLocation :: IO FilePath getCacheFileLocation = do- cdir <- getXdgDirectory XdgCache ""+ home <- getUserDocumentsDirectory+ let cdir = home </> ".cache" createDirectoryIfMissing True cdir let cacheFile = cdir </> "pgdl" return cacheFile
src/Networking.hs view
@@ -36,7 +36,7 @@ Nothing -> error $ "invalid url: " ++ path Just r -> auth r where- path = T.unpack url ++ T.unpack rp+ path = T.unpack url </> T.unpack rp auth = case up of Nothing -> id Just (u, p) -> applyBasicAuth (encodeUtf8 u) (encodeUtf8 p)@@ -67,12 +67,12 @@ | isDirectory e = return $ Directory e childs | otherwise = do downloaded <- isFileDownloaded (decodedName e) lcd- return $ File e (url `T.append` href e) downloaded+ return $ File e (T.pack $ T.unpack url </> T.unpack (href e)) downloaded where childs :: IO [DNode] childs = do html' <- getWebpage nr newUrl mapM (toDNode newUrl) . sortBy (flip $ comparing lastModified) $ parseDirectoryListing html'- newUrl = url `T.append` href e + newUrl = T.pack $ T.unpack url </> T.unpack (href e) forkIO $ writeCache entries mapM (toDNode "") entries