mirror of
https://github.com/rachelos/we-mp-rss.git
synced 2026-08-30 18:01:55 +08:00
1.5.2-Fix
This commit is contained in:
+5
-6
@@ -157,13 +157,12 @@ class Db:
|
||||
and existing_article.status!=DATA_STATUS.DELETED \
|
||||
and art.title==existing_article.title: # type: ignore
|
||||
return False
|
||||
art.content=existing_article.content # type: ignore
|
||||
art.content_html = sanitize_utf8(art.content_html) if art.content_html else None # type: ignore
|
||||
if art.content_html is None:
|
||||
|
||||
if art.content is None:
|
||||
from tools.fix import fix_html
|
||||
art.content_html = fix_html(art.content) # type: ignore
|
||||
# 设置 has_content 字段
|
||||
art.has_content = 1 if (art.content and art.content.strip()) else 0 # type: ignore
|
||||
# 设置 has_content 字段
|
||||
art.has_content = 1 if (art.content and art.content.strip()) else 0 # type: ignore
|
||||
session.merge(art) # 使用 merge 来更新现有记录
|
||||
session.commit()
|
||||
print_warning(f"Article already exists: {art.id}")
|
||||
@@ -185,7 +184,7 @@ class Db:
|
||||
art.content = sanitize_utf8(art.content) if art.content else None # type: ignore
|
||||
art.content_html = sanitize_utf8(art.content_html) if art.content_html else None # type: ignore
|
||||
|
||||
if art.content_html is None:
|
||||
if art.content is not None:
|
||||
from tools.fix import fix_html
|
||||
art.content_html = fix_html(art.content) # type: ignore
|
||||
|
||||
|
||||
Reference in New Issue
Block a user