Reorganize saving, generate feed

This commit is contained in:
Christoph Hagen
2024-12-03 13:19:50 +01:00
parent 3c950d47a2
commit dc7b7a0e90
27 changed files with 717 additions and 411 deletions

View File

@ -13,6 +13,9 @@ import Foundation
*/
final class Storage {
static let outputPathBookmarkKey = "outputPathBookmark"
static let contentPathBookmarkKey = "contentPathBookmark"
private(set) var baseFolder: URL
private let encoder = JSONEncoder()
@ -252,7 +255,7 @@ final class Storage {
private func deleteFiles(in folder: URL, notIn fileSet: Set<String>) throws {
let filesToDelete = try files(in: folder)
.filter { !fileSet.contains($0.lastPathComponent) }
for file in filesToDelete {
try fm.removeItem(at: file)
print("Deleted \(file.path())")