Add gpx type, fix file replacement

This commit is contained in:
Christoph Hagen
2025-04-29 16:57:02 +02:00
parent 3c7681b769
commit f3de1b72b6
4 changed files with 20 additions and 3 deletions

View File

@@ -108,7 +108,11 @@ final class FileResource: Item, LocalizedItem {
}
func save(textContent: String) -> Bool {
content.storage.save(fileContent: textContent, for: id)
guard content.storage.save(fileContent: textContent, for: id) else {
return false
}
modifiedDate = .now
return true
}
func dataContent() -> Foundation.Data? {

View File

@@ -90,6 +90,8 @@ enum FileType: String {
case txt
case gpx
// MARK: Model
case stl
@@ -164,7 +166,7 @@ enum FileType: String {
return .video
case .mp3, .aac, .m4b, .m4a:
return .audio
case .json, .conf, .yaml, .txt:
case .json, .conf, .yaml, .txt, .gpx:
return .text
case .html, .cpp, .swift, .sh, .js, .css:
return .code