/*
- Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
/** @file src/upload_job.cc
* @brief A job to copy DCPs to a server using libcurl.
*/
+
#include "compose.hpp"
-#include "upload_job.h"
#include "config.h"
-#include "log.h"
+#include "curl_uploader.h"
#include "dcpomatic_log.h"
#include "film.h"
+#include "log.h"
#include "scp_uploader.h"
-#include "curl_uploader.h"
+#include "upload_job.h"
#include <iostream>
#include "i18n.h"
+
using std::string;
using std::min;
using std::shared_ptr;
using namespace boost::placeholders;
#endif
+
UploadJob::UploadJob (shared_ptr<const Film> film)
: Job (film)
, _status (_("Waiting"))
}
+
UploadJob::~UploadJob ()
{
stop_thread ();
}
+
string
UploadJob::name () const
{
return _("Copy DCP to TMS");
}
+
string
UploadJob::json_name () const
{
return N_("upload");
}
+
void
UploadJob::run ()
{
set_state (FINISHED_OK);
}
+
string
UploadJob::status () const
{
boost::mutex::scoped_lock lm (_status_mutex);
- string s = Job::status ();
- if (!_status.empty () && !finished_in_error ()) {
+ auto s = Job::status ();
+ if (!_status.empty() && !finished_in_error()) {
s += N_("; ") + _status;
}
return s;
}
+
void
UploadJob::set_status (string s)
{