Forráskód Böngészése

--select-file option is now available in aria2.changeOption

--select-file option is now available in aria2.changeOption if a
download is waiting/paused in queue.
Tatsuhiro Tsujikawa 14 éve
szülő
commit
1d9e673a68
2 módosított fájl, 7 hozzáadás és 0 törlés
  1. 1 0
      src/OptionHandlerFactory.cc
  2. 6 0
      src/RpcMethodImpl.cc

+ 1 - 0
src/OptionHandlerFactory.cc

@@ -1475,6 +1475,7 @@ OptionHandlerFactory::createOptionHandlers()
     op->addTag(TAG_BITTORRENT);
     op->addTag(TAG_METALINK);
     op->setInitialOption(true);
+    op->setChangeOptionForReserved(true);
     handlers.push_back(op);
   }
   {

+ 6 - 0
src/RpcMethodImpl.cc

@@ -1128,6 +1128,12 @@ void changeOption
     util::lowercase(p.second);
     dctx->setDigest(p.first, util::fromHex(p.second));
   }
+  if(option.defined(PREF_SELECT_FILE)) {
+    SegList<int> sgl;
+    util::parseIntSegments(sgl, option.get(PREF_SELECT_FILE));
+    sgl.normalize();
+    dctx->setFileFilter(sgl);
+  }
   if(option.defined(PREF_MAX_DOWNLOAD_LIMIT)) {
     group->setMaxDownloadSpeedLimit
       (option.getAsInt(PREF_MAX_DOWNLOAD_LIMIT));