Fix icons, external file rename
This commit is contained in:
@ -116,6 +116,23 @@ final class FileResource: Item {
|
||||
default: return content.settings.paths.filesOutputFolderPath
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: File
|
||||
|
||||
func update(id newId: String) -> Bool {
|
||||
guard !isExternallyStored else {
|
||||
id = newId
|
||||
return true
|
||||
}
|
||||
do {
|
||||
try content.storage.move(file: id, to: newId)
|
||||
id = newId
|
||||
return true
|
||||
} catch {
|
||||
print("Failed to move file \(id) to \(newId)")
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension FileResource: Identifiable {
|
||||
|
Reference in New Issue
Block a user