Rework storage structs, link preview
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user