diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-07-04 18:04:49 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-07-04 18:04:49 +0400 |
commit | 1d1786e518d673969724abe759ff5cfc71f67bfe (patch) | |
tree | e8a69e41688a8ef68bfdf56d848c558512548900 /src/Network/BitTorrent/Tracker.hs | |
parent | 5d390922115b28c010410481e751cea06d5bb693 (diff) |
~ Add more JSON instances.
Diffstat (limited to 'src/Network/BitTorrent/Tracker.hs')
-rw-r--r-- | src/Network/BitTorrent/Tracker.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Tracker.hs b/src/Network/BitTorrent/Tracker.hs index f7d88bd9..2b8fab07 100644 --- a/src/Network/BitTorrent/Tracker.hs +++ b/src/Network/BitTorrent/Tracker.hs | |||
@@ -277,6 +277,8 @@ data ScrapeInfo = ScrapeInfo { | |||
277 | , siName :: !(Maybe Text) | 277 | , siName :: !(Maybe Text) |
278 | } deriving (Show, Eq) | 278 | } deriving (Show, Eq) |
279 | 279 | ||
280 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''ScrapeInfo) | ||
281 | |||
280 | -- | Scrape info about a set of torrents. | 282 | -- | Scrape info about a set of torrents. |
281 | type Scrape = Map InfoHash ScrapeInfo | 283 | type Scrape = Map InfoHash ScrapeInfo |
282 | 284 | ||
@@ -295,8 +297,6 @@ instance BEncodable ScrapeInfo where | |||
295 | <*> d >--? "name" | 297 | <*> d >--? "name" |
296 | fromBEncode _ = decodingError "ScrapeInfo" | 298 | fromBEncode _ = decodingError "ScrapeInfo" |
297 | 299 | ||
298 | $(deriveJSON (L.map toLower . L.dropWhile isLower) ''ScrapeInfo) | ||
299 | |||
300 | -- | Trying to convert /announce/ URL to /scrape/ URL. If 'scrapeURL' | 300 | -- | Trying to convert /announce/ URL to /scrape/ URL. If 'scrapeURL' |
301 | -- gives 'Nothing' then tracker do not support scraping. The info hash | 301 | -- gives 'Nothing' then tracker do not support scraping. The info hash |
302 | -- list is used to restrict the tracker's report to that particular | 302 | -- list is used to restrict the tracker's report to that particular |