Rename FUID field to key everywhere.
This commit is contained in:
@@ -60,10 +60,10 @@ export const useDocumentStore = defineStore({
|
||||
// Transform data
|
||||
const dataMapped = []
|
||||
for (const [name, attr] of Object.entries(matched)) {
|
||||
const { id, size, mtime } = attr
|
||||
const { key, size, mtime } = attr
|
||||
const element: Document = {
|
||||
name,
|
||||
key: id,
|
||||
key,
|
||||
size,
|
||||
sizedisp: formatSize(size),
|
||||
mtime,
|
||||
@@ -182,21 +182,22 @@ export const useDocumentStore = defineStore({
|
||||
if (!('dir' in data)) return
|
||||
for (const [name, attr] of Object.entries(data.dir)) {
|
||||
const fullname = path ? `${path}/${name}` : name
|
||||
const key = attr.key
|
||||
// Is this the file we are looking for? Ignore if nested within another selection.
|
||||
let r = relpath
|
||||
if (selected.has(attr.id) && !relpath) {
|
||||
ret.selected.add(attr.id)
|
||||
if (selected.has(key) && !relpath) {
|
||||
ret.selected.add(key)
|
||||
ret.rootdir[name] = attr
|
||||
r = name
|
||||
} else if (relpath) {
|
||||
r = `${relpath}/${name}`
|
||||
}
|
||||
if (r) {
|
||||
ret.entries[attr.id] = attr
|
||||
ret.fullpath[attr.id] = fullname
|
||||
ret.relpath[attr.id] = r
|
||||
ret.ids.push(attr.id)
|
||||
if (!('dir' in attr)) ret.url[attr.id] = `/files/${fullname}`
|
||||
ret.entries[key] = attr
|
||||
ret.fullpath[key] = fullname
|
||||
ret.relpath[key] = r
|
||||
ret.ids.push(key)
|
||||
if (!('dir' in attr)) ret.url[key] = `/files/${fullname}`
|
||||
}
|
||||
traverseDir(attr, fullname, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user