-- TODO: Will be available in libtorrent 1.1.0
-- getIsLoaded :: MonadIO m =>  TorrentStatus -> m Bool
-- getIsLoaded ho =
--   liftIO . withPtr ho $ \hoPtr ->
--   toBool <$> [CU.exp| bool { $(torrent_status * hoPtr)->is_loaded } |]

-- getAnnouncingToTrackers :: MonadIO m =>  TorrentStatus -> m Bool
-- getAnnouncingToTrackers ho =
--   liftIO . withPtr ho $ \hoPtr ->
--   toBool <$> [CU.exp| bool { $(torrent_status * hoPtr)->announcing_to_trackers } |]

-- getAnnouncingToLsd :: MonadIO m =>  TorrentStatus -> m Bool
-- getAnnouncingToLsd ho =
--   liftIO . withPtr ho $ \hoPtr ->
--   toBool <$> [CU.exp| bool { $(torrent_status * hoPtr)->announcing_to_lsd } |]

-- getAnnouncingToDht :: MonadIO m =>  TorrentStatus -> m Bool
-- getAnnouncingToDht ho =
--   liftIO . withPtr ho $ \hoPtr ->
--   toBool <$> [CU.exp| bool { $(torrent_status * hoPtr)->announcing_to_dht } |]

-- getStopWhenReady :: MonadIO m =>  TorrentStatus -> m Bool
-- getStopWhenReady ho =
--   liftIO . withPtr ho $ \hoPtr ->
--   toBool <$> [CU.exp| bool { $(torrent_status * hoPtr)->stop_when_ready } |]

getTorrentStatusInfoHash :: MonadIO m =>  TorrentStatus -> m Sha1Hash
getTorrentStatusInfoHash ho =
  liftIO . withPtr ho $ \hoPtr ->
  fromPtr [CU.exp| sha1_hash * { new sha1_hash($(torrent_status * hoPtr)->info_hash) } |]
getTorrentStatusInfoHash :: MonadIO m =>  TorrentStatus -> m Sha1Hash
getTorrentStatusInfoHash ho =
  liftIO . withPtr ho $ \hoPtr ->
  fromPtr [CU.exp| sha1_hash * { new sha1_hash($(torrent_status * hoPtr)->info_hash) } |]
getTorrentStatusInfoHash ho =
  liftIO . withPtr ho $ \hoPtr ->
  fromPtr [CU.exp| sha1_hash * { new sha1_hash($(torrent_status * hoPtr)->info_hash) } |]