* 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:
rakshasa
2006-12-05 09:50:59 +00:00
parent e4db1cacc2
commit 59b6ed61ce
3 changed files with 46 additions and 6 deletions
+9 -5
View File
@@ -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"));