From 47391f88bb8fea2f60922566292b92ebd0f1daa9 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Mon, 11 May 2020 12:27:15 +0200 Subject: webbox info page bugfix: Exception on directory filesize --- plugins/webbox/webbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins/webbox') 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(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)
"s; } else { + auto filesize {fs::file_size(path)}; result += filename + ", "s + std::to_string(filesize) + " bytes, "s + last_write_time + " (file)
"s; } -- cgit v1.2.3