diff options
author | David Crocker <dcrocker@eschertech.com> | 2022-01-08 23:42:23 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2022-01-08 23:42:23 +0300 |
commit | a3bbf6bf18a167b76739af16ba8f186183d812ae (patch) | |
tree | 88402a2fd25ecf6c2fea31602da798c21e992763 /src | |
parent | 45102c559448a299f6441eefd0c990034f8388c9 (diff) |
Corrections to previous commit
Diffstat (limited to 'src')
-rw-r--r-- | src/Platform/RepRap.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Platform/RepRap.cpp b/src/Platform/RepRap.cpp index aafa3027..e9ba6a33 100644 --- a/src/Platform/RepRap.cpp +++ b/src/Platform/RepRap.cpp @@ -2277,7 +2277,7 @@ OutputBuffer *RepRap::GetThumbnailResponse(const char *filename, FilePosition of return nullptr; } - response->printf("{\"name\":\"%.s\",\"offset\":%" PRIu32 ",", filename, offset); + response->printf("{\"fileName\":\"%.s\",\"offset\":%" PRIu32 ",", filename, offset); FileStore *const f = platform->OpenFile(platform->GetGCodeDir(), filename, OpenMode::read); unsigned int err = 0; if (f != nullptr) @@ -2376,7 +2376,7 @@ GCodeResult RepRap::GetFileInfoResponse(const char *filename, OutputBuffer *&res if (info.isValid) { - response->printf("{\"err\":0,\"name\":\"%.s\",\"size\":%lu,", ((specificFile) ? filename : printMonitor->GetPrintingFilename()), info.fileSize); + response->printf("{\"err\":0,\"fileName\":\"%.s\",\"size\":%lu,", ((specificFile) ? filename : printMonitor->GetPrintingFilename()), info.fileSize); tm timeInfo; gmtime_r(&info.lastModifiedTime, &timeInfo); if (timeInfo.tm_year > /*19*/80) @@ -2411,6 +2411,11 @@ GCodeResult RepRap::GetFileInfoResponse(const char *filename, OutputBuffer *&res } response->cat(']'); + if (!specificFile) + { + response->catf(",\"printDuration\":%d", (int)printMonitor->GetPrintDuration()); + } + // See if we have any thumbnails if (info.thumbnails[0].IsValid()) { @@ -2427,11 +2432,6 @@ GCodeResult RepRap::GetFileInfoResponse(const char *filename, OutputBuffer *&res response->cat(']'); } - if (!specificFile) - { - response->catf(",\"printDuration\":%d,\"fileName\":\"%.s\"", (int)printMonitor->GetPrintDuration(), printMonitor->GetPrintingFilename()); - } - response->catf(",\"generatedBy\":\"%.s\"}\n", info.generatedBy.c_str()); return GCodeResult::ok; } |