Rename FUID field to key everywhere.

This commit is contained in:
Leo Vasanko
2023-11-05 15:54:55 +00:00
parent 9d3d27faf3
commit 14f7253ece
4 changed files with 24 additions and 20 deletions

View File

@@ -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)
}