Full generation, file type cleanup

This commit is contained in:
Christoph Hagen
2024-12-25 18:06:05 +01:00
parent 41887a1401
commit 1e4682dad1
56 changed files with 1577 additions and 1103 deletions

View File

@ -28,8 +28,8 @@ final class FileResource: Item {
/**
Only for bundle images
*/
init(resourceImage: String, type: ImageFileType) {
self.type = .image(type)
init(resourceImage: String, type: FileType) {
self.type = type
self.english = "A test image included in the bundle"
self.german = "Ein Testbild aus dem Bundle"
self.isExternallyStored = true
@ -87,18 +87,20 @@ final class FileResource: Item {
return makeCleanAbsolutePath(path)
}
var assetUrl: String {
let path = content.settings.paths.assetsOutputFolderPath + "/" + id
return makeCleanAbsolutePath(path)
}
private var pathPrefix: String {
switch type {
case .image: return content.settings.paths.imagesOutputFolderPath
case .video: return content.settings.paths.videosOutputFolderPath
default: return content.settings.paths.filesOutputFolderPath
if type.isImage {
return content.settings.paths.imagesOutputFolderPath
}
if type.isVideo {
return content.settings.paths.videosOutputFolderPath
}
if type.isAudio {
}
if type.isAsset {
return content.settings.paths.assetsOutputFolderPath
}
return content.settings.paths.filesOutputFolderPath
}
// MARK: File