diff --git a/article_auto_image_matching.py b/article_auto_image_matching.py index 1ccd08c..47b398a 100644 --- a/article_auto_image_matching.py +++ b/article_auto_image_matching.py @@ -97,9 +97,7 @@ class ArticleImageMatcher: a.coze_tag, a.department FROM ai_articles a - WHERE a.coze_tag IS NOT NULL - AND a.coze_tag != '' - AND NOT EXISTS ( + WHERE NOT EXISTS ( SELECT 1 FROM ai_article_images ai WHERE ai.article_id = a.id ) @@ -748,6 +746,10 @@ class ArticleImageMatcher: try: # 解析文章标签 + if not coze_tag: + logger.warning(f"文章 {article_id} 没有标签信息,跳过") + return False + article_tags = self.parse_article_tags(coze_tag) if not article_tags: logger.warning(f"文章 {article_id} 没有有效标签,跳过")