fix stat on Android, add operations to nan ctime mtime and undefined size

This commit is contained in:
fyears
2022-05-10 21:15:30 +08:00
parent 4e8bec9511
commit 28bd861c9e
5 changed files with 56 additions and 21 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ import { requireApiVersion, TAbstractFile, TFile, TFolder } from "obsidian";
import { API_VER_STAT_FOLDER, SUPPORTED_SERVICES_TYPE } from "./baseTypes";
import type { SyncPlanType } from "./sync";
import { toText, unixTimeToStr } from "./misc";
import { statFix, toText, unixTimeToStr } from "./misc";
import { log } from "./moreOnLog";
@@ -417,7 +417,7 @@ export const insertRenameRecordByVault = async (
if (requireApiVersion(API_VER_STAT_FOLDER)) {
// TAbstractFile does not contain these info
// but from API_VER_STAT_FOLDER we can manually stat them by path.
const s = await fileOrFolder.vault.adapter.stat(fileOrFolder.path);
const s = await statFix(fileOrFolder.vault, fileOrFolder.path);
ctime = s.ctime;
mtime = s.mtime;
}