diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-04-17 21:08:24 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-04-17 21:08:24 +0900 |
| commit | c9e2223741f9627f27b3d2befef48acdd79d504d (patch) | |
| tree | 9450a2236f29dab85adb96a04dcdf6723175cee2 /src/RpcMethodImpl.cc | |
| parent | 79298daf5feff76e2f7739e37c9f853d722afc94 (diff) | |
| parent | ca634a82bde8764681a0abbedb38a23222dde608 (diff) | |
Merge branch 'add-btkey-to-completed'
Diffstat (limited to 'src/RpcMethodImpl.cc')
| -rw-r--r-- | src/RpcMethodImpl.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/RpcMethodImpl.cc b/src/RpcMethodImpl.cc index d808d83c..058dda82 100644 --- a/src/RpcMethodImpl.cc +++ b/src/RpcMethodImpl.cc @@ -907,6 +907,18 @@ void gatherStoppedDownload(Dict* entryDict, if (requested_key(keys, KEY_DIR)) { entryDict->put(KEY_DIR, ds->dir); } + +#ifdef ENABLE_BITTORRENT + if (ds->attrs.size() > CTX_ATTR_BT && ds->attrs[CTX_ATTR_BT]) { + const auto attrs = + static_cast<TorrentAttribute*>(ds->attrs[CTX_ATTR_BT].get()); + if (requested_key(keys, KEY_BITTORRENT)) { + auto btDict = Dict::g(); + gatherBitTorrentMetadata(btDict.get(), attrs); + entryDict->put(KEY_BITTORRENT, std::move(btDict)); + } + } +#endif // ENABLE_BITTORRENT } std::unique_ptr<ValueBase> GetFilesRpcMethod::process(const RpcRequest& req, |
