Add route files, show overview

This commit is contained in:
Christoph Hagen
2025-08-21 20:26:22 +02:00
parent 43b761b593
commit 9ec207014c
14 changed files with 938 additions and 3 deletions

View File

@@ -125,6 +125,15 @@ final class FileResource: Item, LocalizedItem {
return true
}
@discardableResult
func save(fileData: Foundation.Data) -> Bool {
guard content.storage.save(fileData: fileData, for: identifier) else {
return false
}
modifiedDate = .now
return true
}
func dataContent() -> Foundation.Data? {
content.storage.fileData(for: identifier)
}

View File

@@ -9,6 +9,7 @@ enum FileTypeCategory: String, CaseIterable {
case video
case resource
case audio
case route
var text: String {
switch self {
@@ -19,6 +20,7 @@ enum FileTypeCategory: String, CaseIterable {
case .video: return "Videos"
case .resource: return "Other"
case .audio: return "Audio"
case .route: return "Route"
}
}
@@ -31,6 +33,7 @@ enum FileTypeCategory: String, CaseIterable {
case .video: .video
case .resource: .zipperPage
case .audio: .speakerWave2CircleFill
case .route: .map
}
}
}
@@ -138,6 +141,10 @@ enum FileType: String {
case psd
// MARK: Route
case route
// MARK: Unknown
case unknown
@@ -174,6 +181,8 @@ enum FileType: String {
return .model
case .zip, .cddx, .pdf, .key, .psd, .ttf:
return .resource
case .route:
return .route
case .noExtension, .unknown:
return .resource
}