From 8e0ab80930d39a005f8dc7692f871e7fbe5e3723 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 19 Feb 2014 12:12:01 +0000 Subject: Put DCP name in JSON. --- src/lib/job.h | 4 ++++ src/lib/json_server.cc | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/lib') 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 film () const { + return _film; + } + boost::signals2::signal Progress; /** Emitted from the UI thread when the job is finished */ boost::signals2::signal 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 socket) json << "{ \"jobs\": ["; for (list >::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 >::iterator j = i; -- cgit v1.2.3