summaryrefslogtreecommitdiff
path: root/src/lib/upload_job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-04-29 00:47:47 +0200
committerCarl Hetherington <cth@carlh.net>2025-06-03 22:46:26 +0200
commitfb5b8ae43e373c37b78202217528be73efa162cc (patch)
tree9dfb23d6188ba86485795eb13876ebc01f560874 /src/lib/upload_job.cc
parenteb2452d1d76e7b87a61e88773b29206ff5833e34 (diff)
Allow multiple upload destinations instead of just the TMS.
Diffstat (limited to 'src/lib/upload_job.cc')
-rw-r--r--src/lib/upload_job.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/upload_job.cc b/src/lib/upload_job.cc
index 113e3a7e8..b43526c56 100644
--- a/src/lib/upload_job.cc
+++ b/src/lib/upload_job.cc
@@ -32,22 +32,23 @@
#include "log.h"
#include "scp_uploader.h"
#include "upload_job.h"
-#include <iostream>
+#include <fmt/format.h>
#include "i18n.h"
-using std::string;
using std::min;
using std::shared_ptr;
+using std::string;
using boost::scoped_ptr;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
-UploadJob::UploadJob (shared_ptr<const Film> film)
+UploadJob::UploadJob(shared_ptr<const Film> film, UploadDestination destination)
: Job (film)
+ , _destination(destination)
, _status (_("Waiting"))
{
@@ -63,7 +64,7 @@ UploadJob::~UploadJob ()
string
UploadJob::name () const
{
- return _("Copy DCP to TMS");
+ return fmt::format(_("Copy DCP to {}"), _destination.name);
}
@@ -80,12 +81,12 @@ UploadJob::run ()
LOG_GENERAL_NC (N_("Upload job starting"));
scoped_ptr<Uploader> uploader;
- switch (Config::instance()->tms_protocol()) {
+ switch (_destination.protocol) {
case FileTransferProtocol::SCP:
- uploader.reset (new SCPUploader(bind (&UploadJob::set_status, this, _1), bind(&UploadJob::set_progress, this, _1, false)));
+ uploader.reset(new SCPUploader(_destination, bind(&UploadJob::set_status, this, _1), bind(&UploadJob::set_progress, this, _1, false)));
break;
case FileTransferProtocol::FTP:
- uploader.reset (new CurlUploader(bind (&UploadJob::set_status, this, _1), bind(&UploadJob::set_progress, this, _1, false)));
+ uploader.reset(new CurlUploader(_destination, bind(&UploadJob::set_status, this, _1), bind(&UploadJob::set_progress, this, _1, false)));
break;
}