Put DCP name in JSON.
authorCarl Hetherington <cth@carlh.net>
Wed, 19 Feb 2014 12:12:01 +0000 (12:12 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 19 Feb 2014 12:12:01 +0000 (12:12 +0000)
src/lib/job.h
src/lib/json_server.cc

index 489464558764bc348d85f741f0ddd634ddbdb9b0..5e3127dc158a432522590ffec566e5cfa1e21bbf 100644 (file)
@@ -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;
index 9d625a287ff454d3da10c9fca6581051de84546d..f4aa292d7779ca8cee77af2855b489242738d6fe 100644 (file)
@@ -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;