Rework storage structs, link preview

This commit is contained in:
Christoph Hagen
2025-01-08 14:59:04 +01:00
parent b99c064d10
commit a7197b9628
75 changed files with 1365 additions and 1454 deletions

View File

@@ -23,23 +23,54 @@ final class PathSettings: ObservableObject {
@Published
var tagsOutputFolderPath: String
init(file: PathSettingsFile) {
self.assetsOutputFolderPath = file.assetsOutputFolderPath
self.pagesOutputFolderPath = file.pagesOutputFolderPath
self.imagesOutputFolderPath = file.imagesOutputFolderPath
self.filesOutputFolderPath = file.filesOutputFolderPath
self.videosOutputFolderPath = file.videosOutputFolderPath
self.tagsOutputFolderPath = file.tagsOutputFolderPath
self.audioOutputFolderPath = file.audioOutputFolderPath
}
var file: PathSettingsFile {
.init(assetsOutputFolderPath: assetsOutputFolderPath,
pagesOutputFolderPath: pagesOutputFolderPath,
imagesOutputFolderPath: imagesOutputFolderPath,
filesOutputFolderPath: filesOutputFolderPath,
videosOutputFolderPath: videosOutputFolderPath,
tagsOutputFolderPath: tagsOutputFolderPath,
audioOutputFolderPath: audioOutputFolderPath)
init(assetsOutputFolderPath: String,
pagesOutputFolderPath: String,
imagesOutputFolderPath: String,
filesOutputFolderPath: String,
videosOutputFolderPath: String,
audioOutputFolderPath: String,
tagsOutputFolderPath: String) {
self.assetsOutputFolderPath = assetsOutputFolderPath
self.pagesOutputFolderPath = pagesOutputFolderPath
self.imagesOutputFolderPath = imagesOutputFolderPath
self.filesOutputFolderPath = filesOutputFolderPath
self.videosOutputFolderPath = videosOutputFolderPath
self.audioOutputFolderPath = audioOutputFolderPath
self.tagsOutputFolderPath = tagsOutputFolderPath
}
}
extension PathSettings {
convenience init(data: Data) {
self.init(
assetsOutputFolderPath: data.assetsOutputFolderPath,
pagesOutputFolderPath: data.pagesOutputFolderPath,
imagesOutputFolderPath: data.imagesOutputFolderPath,
filesOutputFolderPath: data.filesOutputFolderPath,
videosOutputFolderPath: data.videosOutputFolderPath,
audioOutputFolderPath: data.audioOutputFolderPath,
tagsOutputFolderPath: data.tagsOutputFolderPath)
}
var data: Data {
.init(
assetsOutputFolderPath: assetsOutputFolderPath,
pagesOutputFolderPath: pagesOutputFolderPath,
imagesOutputFolderPath: imagesOutputFolderPath,
filesOutputFolderPath: filesOutputFolderPath,
videosOutputFolderPath: videosOutputFolderPath,
audioOutputFolderPath: audioOutputFolderPath,
tagsOutputFolderPath: tagsOutputFolderPath)
}
struct Data: Codable {
let assetsOutputFolderPath: String
let pagesOutputFolderPath: String
let imagesOutputFolderPath: String
let filesOutputFolderPath: String
let videosOutputFolderPath: String
let audioOutputFolderPath: String
let tagsOutputFolderPath: String
}
}