buildTorrentPaths :: SiteSettings -> ABTorrentGroup -> [(Maybe FilePath, URL)]
buildTorrentPaths sett g =
  map (makePath &&& _torrentDownloadURI) $ _torrents g
  where
    makePath :: ABTorrent -> Maybe FilePath
    makePath tor = case _torrentCategory g of
      Nothing -> Nothing
      Just cat -> foldl (liftA2 (</>)) (_topWatch sett)
                  [ _watchFunc sett cat
                  , Just $ unwords [ _torrentName g, "-"
                                   , show cat
                                   , "~"
                                   , _torrentInfoSuffix tor <.> "torrent"
                                   ]
                  ]

-- | Starts the crawl from a saved page.
buildTorrentPaths :: SiteSettings -> ABTorrentGroup -> [(Maybe FilePath, URL)]
buildTorrentPaths sett g =
  map (makePath &&& _torrentDownloadURI) $ _torrents g
  where
    makePath :: ABTorrent -> Maybe FilePath
    makePath tor = case _torrentCategory g of
      Nothing -> Nothing
      Just cat -> foldl (liftA2 (</>)) (_topWatch sett)
                  [ _watchFunc sett cat
                  , Just $ unwords [ _torrentName g, "-"
                                   , show cat
                                   , "~"
                                   , _torrentInfoSuffix tor <.> "torrent"
                                   ]
                  ]

-- | Starts the crawl from a saved page.
buildTorrentPaths sett g =
  map (makePath &&& _torrentDownloadURI) $ _torrents g
  where
    makePath :: ABTorrent -> Maybe FilePath
    makePath tor = case _torrentCategory g of
      Nothing -> Nothing
      Just cat -> foldl (liftA2 (</>)) (_topWatch sett)
                  [ _watchFunc sett cat
                  , Just $ unwords [ _torrentName g, "-"
                                   , show cat
                                   , "~"
                                   , _torrentInfoSuffix tor <.> "torrent"
                                   ]
                  ]

-- | Starts the crawl from a saved page.