chore: exclude ai columns (#5526)

This commit is contained in:
Nathan.fooo
2024-06-13 11:15:59 +08:00
committed by GitHub
parent 15329b39d0
commit ecca81f3b8
5 changed files with 64 additions and 41 deletions

View File

@ -495,6 +495,10 @@ impl FieldType {
s.to_string()
}
pub fn is_ai_field(&self) -> bool {
matches!(self, FieldType::Summary | FieldType::Translate)
}
pub fn is_number(&self) -> bool {
matches!(self, FieldType::Number)
}

View File

@ -435,8 +435,7 @@ impl DatabaseManager {
// When summarizing a row, skip the content in the "AI summary" cell; it does not need to
// be summarized.
if field.id != field_id {
// Don't summarize the summary field.
if field.field_type == FieldType::Summary as i64 {
if FieldType::from(field.field_type).is_ai_field() {
continue;
}
if let Some(cell) = row.cells.get(&field.id) {
@ -482,8 +481,7 @@ impl DatabaseManager {
// When translate a row, skip the content in the "AI Translate" cell; it does not need to
// be translated.
if field.id != field_id {
// Don't translate the translate field.
if field.field_type == FieldType::Translate as i64 {
if FieldType::from(field.field_type).is_ai_field() {
continue;
}