diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-05-11 12:27:15 +0200 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-05-11 12:27:15 +0200 |
commit | 47391f88bb8fea2f60922566292b92ebd0f1daa9 (patch) | |
tree | 62690e62c7a1b08a072a8edfb6f914382cd10859 /plugins/webbox | |
parent | 5bc1f7bed536e0e936fd13fad45c49392b0bfff4 (diff) |
webbox info page bugfix: Exception on directory filesize
Diffstat (limited to 'plugins/webbox')
-rw-r--r-- | plugins/webbox/webbox.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/webbox/webbox.cpp b/plugins/webbox/webbox.cpp index 01241a9..12e62ef 100644 --- a/plugins/webbox/webbox.cpp +++ b/plugins/webbox/webbox.cpp @@ -429,8 +429,6 @@ protected: std::string filename{element.second.data()}; fs::path path {p.m_path / filename}; - auto filesize {fs::file_size(path)}; - fs::file_time_type ftime {fs::last_write_time(path)}; auto sctp = std::chrono::time_point_cast<std::chrono::system_clock::duration>(ftime - fs::file_time_type::clock::now() + std::chrono::system_clock::now()); @@ -440,6 +438,7 @@ protected: if (fs::is_directory(path)) { result += filename + ", "s + last_write_time + " (folder)<br>"s; } else { + auto filesize {fs::file_size(path)}; result += filename + ", "s + std::to_string(filesize) + " bytes, "s + last_write_time + " (file)<br>"s; } |