| 239 | } |
| 240 | |
| 241 | void MetalinkParserController::commitResourceTransaction() |
| 242 | { |
| 243 | if (!tResource_) { |
| 244 | return; |
| 245 | } |
| 246 | #ifdef ENABLE_BITTORRENT |
| 247 | if (tResource_->type == MetalinkResource::TYPE_BITTORRENT) { |
| 248 | auto metaurl = make_unique<MetalinkMetaurl>(); |
| 249 | metaurl->url = std::move(tResource_->url); |
| 250 | metaurl->priority = tResource_->priority; |
| 251 | metaurl->mediatype = MetalinkMetaurl::MEDIATYPE_TORRENT; |
| 252 | tEntry_->metaurls.push_back(std::move(metaurl)); |
| 253 | } |
| 254 | else { |
| 255 | tEntry_->resources.push_back(std::move(tResource_)); |
| 256 | } |
| 257 | #else // !ENABLE_BITTORRENT |
| 258 | tEntry_->resources.push_back(std::move(tResource_)); |
| 259 | #endif // !ENABLE_BITTORRENT |
| 260 | tResource_.reset(); |
| 261 | } |
| 262 | |
| 263 | void MetalinkParserController::cancelResourceTransaction() |
| 264 | { |