time fixes
This commit is contained in:
@ -1749,15 +1749,22 @@ auto remote_server::json_release_directory_snapshot(
|
|||||||
|
|
||||||
auto remote_server::update_to_windows_format(json &item) -> json & {
|
auto remote_server::update_to_windows_format(json &item) -> json & {
|
||||||
const auto api_path = item["path"].get<std::string>();
|
const auto api_path = item["path"].get<std::string>();
|
||||||
item["meta"][META_MODIFIED] = std::to_string(
|
|
||||||
utils::time::unix_time_to_windows_time(utils::string::to_uint64(
|
|
||||||
empty_as_zero(item["meta"][META_MODIFIED]))));
|
|
||||||
item["meta"][META_CREATION] = std::to_string(
|
|
||||||
utils::time::unix_time_to_windows_time(utils::string::to_uint64(
|
|
||||||
empty_as_zero(item["meta"][META_CREATION]))));
|
|
||||||
item["meta"][META_ACCESSED] = std::to_string(
|
item["meta"][META_ACCESSED] = std::to_string(
|
||||||
utils::time::unix_time_to_windows_time(utils::string::to_uint64(
|
utils::string::to_uint64(empty_as_zero(item["meta"][META_ACCESSED])));
|
||||||
empty_as_zero(item["meta"][META_ACCESSED]))));
|
item["meta"][META_CREATION] = std::to_string(
|
||||||
|
utils::string::to_uint64(empty_as_zero(item["meta"][META_CREATION])));
|
||||||
|
item["meta"][META_MODIFIED] = std::to_string(
|
||||||
|
utils::string::to_uint64(empty_as_zero(item["meta"][META_MODIFIED])));
|
||||||
|
|
||||||
|
if (item["meta"][META_WRITTEN].empty() ||
|
||||||
|
(item["meta"][META_WRITTEN].get<std::string>() == "0") ||
|
||||||
|
(item["meta"][META_WRITTEN].get<std::string>() ==
|
||||||
|
std::to_string(WIN32_TIME_CONVERSION))) {
|
||||||
|
drive_.set_item_meta(api_path, META_WRITTEN,
|
||||||
|
item["meta"][META_MODIFIED].get<std::string>());
|
||||||
|
item["meta"][META_WRITTEN] = item["meta"][META_MODIFIED];
|
||||||
|
}
|
||||||
|
|
||||||
if (item["meta"][META_ATTRIBUTES].empty()) {
|
if (item["meta"][META_ATTRIBUTES].empty()) {
|
||||||
item["meta"][META_ATTRIBUTES] =
|
item["meta"][META_ATTRIBUTES] =
|
||||||
item["directory"].get<bool>() ? std::to_string(FILE_ATTRIBUTE_DIRECTORY)
|
item["directory"].get<bool>() ? std::to_string(FILE_ATTRIBUTE_DIRECTORY)
|
||||||
@ -1766,19 +1773,6 @@ auto remote_server::update_to_windows_format(json &item) -> json & {
|
|||||||
item["meta"][META_ATTRIBUTES].get<std::string>());
|
item["meta"][META_ATTRIBUTES].get<std::string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item["meta"][META_WRITTEN].empty() ||
|
|
||||||
(item["meta"][META_WRITTEN].get<std::string>() == "0") ||
|
|
||||||
(item["meta"][META_WRITTEN].get<std::string>() == "116444736000000000")) {
|
|
||||||
drive_.set_item_meta(api_path, META_WRITTEN,
|
|
||||||
item["meta"][META_MODIFIED].get<std::string>());
|
|
||||||
item["meta"][META_WRITTEN] = std::to_string(
|
|
||||||
utils::time::unix_time_to_windows_time(utils::string::to_uint64(
|
|
||||||
empty_as_zero(item["meta"][META_MODIFIED]))));
|
|
||||||
} else {
|
|
||||||
item["meta"][META_WRITTEN] = std::to_string(
|
|
||||||
utils::time::unix_time_to_windows_time(utils::string::to_uint64(
|
|
||||||
empty_as_zero(item["meta"][META_WRITTEN]))));
|
|
||||||
}
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
} // namespace repertory::remote_fuse
|
} // namespace repertory::remote_fuse
|
||||||
|
Reference in New Issue
Block a user