Obey DCPOMATIC_LINUX_SHARE_PREFIX in non-debug as well as debug mode.
[dcpomatic.git] / src / lib / json_server.cc
index 1be3c7d0e9d894698534d84d6df4aaeaea265c30..1035c248fccbb3b5abc873e848765214e1c6ebc0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -164,9 +164,13 @@ JSONServer::request (string url, shared_ptr<tcp::socket> socket)
                                json << "\"dcp\": \"" << (*i)->film()->dcp_name() << "\", ";
                        }
                        
-                       json << "\"name\": \""   << (*i)->json_name() << "\", "
-                            << "\"progress\": " << (*i)->progress () << ", "
-                            << "\"status\": \"" << (*i)->json_status() << "\"";
+                       json << "\"name\": \""   << (*i)->json_name() << "\", ";
+                       if ((*i)->progress ()) {
+                               json << "\"progress\": " << (*i)->progress().get() << ", ";
+                       } else {
+                               json << "\"progress\": unknown, ";
+                       }
+                       json << "\"status\": \"" << (*i)->json_status() << "\"";
                        json << " }";
                        
                        list<shared_ptr<Job> >::iterator j = i;