Add mtime only to absolute original_path.
GitOrigin-RevId: 379ab8f47b8f2e4e6bf930977bfae8e26cf5fc60
This commit is contained in:
parent
ecaaae62ef
commit
1cb68fab96
@ -698,11 +698,10 @@ Result<FileId> FileManager::register_generate(FileType file_type, FileLocationSo
|
|||||||
string original_path, string conversion, DialogId owner_dialog_id,
|
string original_path, string conversion, DialogId owner_dialog_id,
|
||||||
int64 expected_size) {
|
int64 expected_size) {
|
||||||
// add #mtime# into conversion
|
// add #mtime# into conversion
|
||||||
if (!original_path.empty() && conversion[0] != '#') {
|
if (!original_path.empty() && conversion[0] != '#' && PathView(original_path).is_absolute()) {
|
||||||
auto r_stat = stat(original_path);
|
auto r_stat = stat(original_path);
|
||||||
uint64 mtime = r_stat.is_ok() ? r_stat.ok().mtime_nsec_ : 0;
|
uint64 mtime = r_stat.is_ok() ? r_stat.ok().mtime_nsec_ : 0;
|
||||||
auto new_conversion = PSTRING() << "#mtime#" << lpad0(to_string(mtime), 20) << '#' << conversion;
|
conversion = PSTRING() << "#mtime#" << lpad0(to_string(mtime), 20) << '#' << conversion;
|
||||||
conversion = std::move(new_conversion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FileData data;
|
FileData data;
|
||||||
|
Loading…
Reference in New Issue
Block a user