summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-02-19 12:12:01 +0000
committerCarl Hetherington <cth@carlh.net>2014-02-19 12:12:01 +0000
commit8e0ab80930d39a005f8dc7692f871e7fbe5e3723 (patch)
tree68ac6d17d2a3a9b4bdd935c8044752cfb1bd3df4 /src/lib
parent830acd944e1a194d8639f51cd72d3839ecd0ecfe (diff)
Put DCP name in JSON.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/job.h4
-rw-r--r--src/lib/json_server.cc11
2 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/job.h b/src/lib/job.h
index 489464558..5e3127dc1 100644
--- a/src/lib/job.h
+++ b/src/lib/job.h
@@ -78,6 +78,10 @@ public:
return !_progress;
}
+ boost::shared_ptr<const Film> film () const {
+ return _film;
+ }
+
boost::signals2::signal<void()> Progress;
/** Emitted from the UI thread when the job is finished */
boost::signals2::signal<void()> Finished;
diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc
index 9d625a287..f4aa292d7 100644
--- a/src/lib/json_server.cc
+++ b/src/lib/json_server.cc
@@ -24,6 +24,7 @@
#include "job_manager.h"
#include "job.h"
#include "util.h"
+#include "film.h"
#include "transcode_job.h"
using std::string;
@@ -157,11 +158,15 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
json << "{ \"jobs\": [";
for (list<shared_ptr<Job> >::iterator i = jobs.begin(); i != jobs.end(); ++i) {
- json << "{ "
- << "\"name\": \"" << (*i)->json_name() << "\", "
+ json << "{ ";
+
+ if ((*i)->film()) {
+ json << "\"dcp\": \"" << (*i)->film()->dcp_name() << "\", ";
+ }
+
+ json << "\"name\": \"" << (*i)->json_name() << "\", "
<< "\"progress\": " << (*i)->progress () << ", "
<< "\"status\": \"" << (*i)->json_status() << "\"";
-
json << " }";
list<shared_ptr<Job> >::iterator j = i;