fix: align AI retouch template rules

This commit is contained in:
2026-08-19 10:06:50 +08:00
parent 1757ba5e36
commit 8cd6c0aac8
8 changed files with 117 additions and 46 deletions
@@ -387,14 +387,13 @@ enum TravelAlbumAIRetouchWorkflow: Sendable, Equatable {
}
}
/// 当前分组是否允许不选择;首次修图和原图 Tab 覆盖重修的氛围感模板选填。
/// 当前分组是否允许不选择;首次修图仅氛围感选填,已有 AI 结果的预览重修两类模板均选填。
func isOptional(_ category: TravelAlbumAIRetouchTemplateCategory) -> Bool {
guard category == .atmosphere else { return false }
switch self {
case .initial:
return true
return category == .atmosphere
case .reretouch(_, _, .all):
return true
return category == .refined || category == .atmosphere
case .reretouch:
return false
}
@@ -175,7 +175,7 @@ struct TravelAlbumPreviewProject: Identifiable, Sendable, Hashable {
self.assets = assets.filter { seenKinds.insert($0.kind).inserted }
}
/// 根据当前 Tab 生成首次修图或覆盖重修工作流。
/// 根据是否已有 AI 结果生成首次修图或双模板覆盖重修工作流。
func aiRetouchWorkflow(
albumId: Int,
selectedKind: TravelAlbumPreviewAssetKind
@@ -183,16 +183,8 @@ struct TravelAlbumPreviewProject: Identifiable, Sendable, Hashable {
guard hasVariants else {
return .initial(albumId: albumId, materialIds: [originalMaterialId])
}
switch selectedKind {
case .original:
return .reretouch(materialId: originalMaterialId, batchId: aiRetouchBatchId, type: .all)
case .retouched:
return .reretouch(materialId: originalMaterialId, batchId: aiRetouchBatchId, type: .refined)
case .atmosphere:
return .reretouch(materialId: originalMaterialId, batchId: aiRetouchBatchId, type: .atmosphere)
case .cover:
return nil
}
guard selectedKind != .cover else { return nil }
return .reretouch(materialId: originalMaterialId, batchId: aiRetouchBatchId, type: .all)
}
}