mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 04:02:30 +00:00
* Added helper functions for splitting files in FileList.
* Added "split_file_size" and "split_suffix" options. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@815 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -45,6 +45,7 @@
|
||||
#include <torrent/exceptions.h>
|
||||
#include <torrent/rate.h>
|
||||
#include <torrent/resume.h>
|
||||
#include <torrent/data/file_utils.h>
|
||||
|
||||
#include "utils/variable_generic.h"
|
||||
|
||||
@@ -193,11 +194,14 @@ DownloadFactory::receive_success() {
|
||||
if (control->variable()->get_value("max_file_size") > 0)
|
||||
download->variable()->set("max_file_size", control->variable()->get("max_file_size"));
|
||||
|
||||
// if (control->variable()->get_value("split_file_size") >= 0)
|
||||
// download->variable()->set("split_file_size", control->variable()->get("split_file_size"));
|
||||
|
||||
// if (!control->variable()->get_string("split_suffix").empty())
|
||||
// download->variable()->set("split_suffix", control->variable()->get("split_suffix"));
|
||||
// Check first if we already have these values set in the session
|
||||
// torrent, so that it is safe to change the values.
|
||||
//
|
||||
// Need to also catch the exceptions.
|
||||
if (control->variable()->get_value("split_file_size") >= 0)
|
||||
torrent::file_split_all(download->download()->file_list(),
|
||||
control->variable()->get_value("split_file_size"),
|
||||
control->variable()->get_string("split_suffix"));
|
||||
|
||||
if (!rtorrent->has_key_string("directory"))
|
||||
download->variable()->set("directory", m_variables.get("directory"));
|
||||
|
||||
@@ -521,7 +521,7 @@ initialize_option_handler(Control* c) {
|
||||
|
||||
variables->insert("max_file_size", new utils::VariableValue(-1));
|
||||
variables->insert("split_file_size", new utils::VariableValue(-1));
|
||||
variables->insert("split_suffix", new utils::VariableAny(""));
|
||||
variables->insert("split_suffix", new utils::VariableAny(".part"));
|
||||
|
||||
variables->insert("port_range", new utils::VariableStringSlot(rak::value_fn(std::string()), rak::bind_ptr_fn(&apply_port_range, c)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user