mirror of https://github.com/logseq/logseq
chore: remove unused :file/handle
parent
be41c8bae7
commit
dec56b31f0
|
@ -107,20 +107,16 @@
|
||||||
|
|
||||||
;; file
|
;; file
|
||||||
:file/path {:db/unique :db.unique/identity}
|
:file/path {:db/unique :db.unique/identity}
|
||||||
|
:file/content {}
|
||||||
:file/created-at {}
|
:file/created-at {}
|
||||||
:file/last-modified-at {}
|
:file/last-modified-at {}
|
||||||
;; only store the content of logseq's files
|
:file/size {}
|
||||||
:file/content {}
|
|
||||||
|
|
||||||
;; TODO: do we really use this?
|
|
||||||
:file/handle {}
|
|
||||||
;; :file/size {}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
(def schema-for-db-based-graph
|
(def schema-for-db-based-graph
|
||||||
(merge
|
(merge
|
||||||
(dissoc schema
|
(dissoc schema
|
||||||
:block/namespace :block/properties-text-values :block/pre-block? :recent/pages :file/handle :block/file
|
:block/namespace :block/properties-text-values :block/pre-block? :recent/pages :block/file
|
||||||
:block/properties :block/properties-order :block/repeated? :block/deadline :block/scheduled :block/priority
|
:block/properties :block/properties-order :block/repeated? :block/deadline :block/scheduled :block/priority
|
||||||
:block/marker :block/macros)
|
:block/marker :block/macros)
|
||||||
{:block/name {:db/index true} ; remove db/unique for :block/name
|
{:block/name {:db/index true} ; remove db/unique for :block/name
|
||||||
|
|
|
@ -85,7 +85,7 @@
|
||||||
[]
|
[]
|
||||||
(let [file-concepts (->>
|
(let [file-concepts (->>
|
||||||
;; from logseq.db.frontend.schema
|
;; from logseq.db.frontend.schema
|
||||||
[:block/properties-text-values :block/pre-block :recent/pages :file/handle :block/file :block/properties-order
|
[:block/properties-text-values :block/pre-block :recent/pages :block/file :block/properties-order
|
||||||
:block/marker :block/priority :block/scheduled :block/deadline :block/macros]
|
:block/marker :block/priority :block/scheduled :block/deadline :block/macros]
|
||||||
(map str)
|
(map str)
|
||||||
(into [;; e.g. block/properties :title
|
(into [;; e.g. block/properties :title
|
||||||
|
|
|
@ -157,8 +157,7 @@
|
||||||
:size (.-size file)
|
:size (.-size file)
|
||||||
:type (.-kind (.-handle file))
|
:type (.-kind (.-handle file))
|
||||||
:content content
|
:content content
|
||||||
:file/file file
|
:file/file file})))))))
|
||||||
:file/handle (.-handle file)})))))))
|
|
||||||
|
|
||||||
(defrecord ^:large-vars/cleanup-todo Nfs []
|
(defrecord ^:large-vars/cleanup-todo Nfs []
|
||||||
protocol/Fs
|
protocol/Fs
|
||||||
|
@ -345,8 +344,7 @@
|
||||||
:type (.-kind (.-handle file))
|
:type (.-kind (.-handle file))
|
||||||
:content content
|
:content content
|
||||||
;; expose the following, they are used by the file system
|
;; expose the following, they are used by the file system
|
||||||
:file/file file
|
:file/file file}))))
|
||||||
:file/handle (.-handle file)}))))
|
|
||||||
files (p/all files)]
|
files (p/all files)]
|
||||||
(add-nfs-file-handle! (str "handle/" dir-name) dir-handle)
|
(add-nfs-file-handle! (str "handle/" dir-name) dir-handle)
|
||||||
(idb/set-item! (str "handle/" dir-name) dir-handle)
|
(idb/set-item! (str "handle/" dir-name) dir-handle)
|
||||||
|
|
|
@ -212,7 +212,7 @@
|
||||||
(:file/content file))]
|
(:file/content file))]
|
||||||
(assoc file :file/content content)))) added-or-modified))
|
(assoc file :file/content content)))) added-or-modified))
|
||||||
(p/then (fn [result]
|
(p/then (fn [result]
|
||||||
(let [files (map #(dissoc % :file/file :file/handle) result)
|
(let [files (map #(dissoc % :file/file) result)
|
||||||
[modified-files modified] (if re-index?
|
[modified-files modified] (if re-index?
|
||||||
[files (set modified)]
|
[files (set modified)]
|
||||||
(let [modified-files (filter (fn [file] (contains? added-or-modified (:file/path file))) files)]
|
(let [modified-files (filter (fn [file] (contains? added-or-modified (:file/path file))) files)]
|
||||||
|
|
Loading…
Reference in New Issue