Fix icons, external file rename

This commit is contained in:
Christoph Hagen
2024-12-14 18:26:11 +01:00
parent be2aab2ea8
commit cdaaa36303
6 changed files with 22 additions and 44 deletions

View File

@ -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 {