mirror of
https://github.com/logseq/logseq.git
synced 2026-05-01 01:16:27 +00:00
enhance(asset-sync): compare local asset-file metadata when generating ops
This commit is contained in:
@@ -217,7 +217,7 @@
|
||||
[]
|
||||
(when-let [path (config/get-current-repo-assets-root)]
|
||||
(p/let [result (p/catch (fs/readdir path {:path-only? true})
|
||||
(fn [_e] nil))]
|
||||
(constantly nil))]
|
||||
(p/all (map (fn [path]
|
||||
(p/let [data (fs/read-file path "" {})]
|
||||
(let [path' (util/node-path.join "assets" (util/node-path.basename path))]
|
||||
@@ -240,7 +240,7 @@
|
||||
[repo]
|
||||
(when-let [path (config/get-repo-assets-root repo)]
|
||||
(p/catch (fs/readdir path {:path-only? true})
|
||||
(fn [_e] nil))))
|
||||
(constantly nil))))
|
||||
|
||||
(defn <read-asset
|
||||
[repo asset-block-id asset-type]
|
||||
@@ -255,7 +255,7 @@
|
||||
blob (js/Blob. (array file) (clj->js {:type "image"}))
|
||||
checksum (get-file-checksum blob)]
|
||||
{:checksum checksum})
|
||||
(p/catch (fn [_e] nil))))
|
||||
(p/catch (constantly nil))))
|
||||
|
||||
(defn <write-asset
|
||||
[repo asset-block-id asset-type data]
|
||||
|
||||
Reference in New Issue
Block a user