Skip to content

Commit

Permalink
filesystem: attach mtime to card objects
Browse files Browse the repository at this point in the history
shagu committed Feb 3, 2024
1 parent 34eedd9 commit e6ecd4f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/filesystem.js
Original file line number Diff line number Diff line change
@@ -135,6 +135,7 @@ class Filesystem {
for (const file of fs.readdirSync(path.join(base, folder))) {
const fsurl = path.join(base, folder, file)
const stat = fs.statSync(fsurl)
const mtime = stat.mtime.getTime()

// handle hidden files and folders
if (file.length > 1 && file.startsWith('.')) {
@@ -166,6 +167,7 @@ class Filesystem {
collection: base,
folder,
file,
mtime,

fsurl
})
@@ -215,6 +217,7 @@ class Filesystem {
}

// update card file data
card.mtime = Date.now()
card.fsurl = fsurl
})

0 comments on commit e6ecd4f

Please sign in to comment.