import Foundation

final class PathSettings: ObservableObject {

    @Published
    var assetsOutputFolderPath: String

    @Published
    var pagesOutputFolderPath: String

    @Published
    var imagesOutputFolderPath: String

    @Published
    var filesOutputFolderPath: String

    @Published
    var videosOutputFolderPath: String

    @Published
    var audioOutputFolderPath: String

    @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)
    }
}
