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

@ -17,7 +17,7 @@ extension ImageToGenerate: Hashable {
final class PageGenerationResults: ObservableObject {
let itemId: ItemId
let itemId: LocalizedItemId
private unowned let delegate: GenerationResults
@ -73,13 +73,13 @@ final class PageGenerationResults: ObservableObject {
private(set) var warnings: Set<String>
/// The files that could not be saved to the output folder
private(set) var unsavedOutputFiles: [String: Set<ItemType>] = [:]
private(set) var unsavedOutputFiles: [String: Set<ItemReference>] = [:]
private(set) var pageIsEmpty: Bool
private(set) var redirect: (originalUrl: String, newUrl: String)?
init(itemId: ItemId, delegate: GenerationResults) {
init(itemId: LocalizedItemId, delegate: GenerationResults) {
self.itemId = itemId
self.delegate = delegate
inaccessibleFiles = []
@ -245,7 +245,7 @@ final class PageGenerationResults: ObservableObject {
delegate.warning(warning)
}
func unsavedOutput(_ path: String, source: ItemType) {
func unsavedOutput(_ path: String, source: ItemReference) {
unsavedOutputFiles[path, default: []].insert(source)
delegate.unsaved(path)
}