mirror of
https://github.com/rachelos/we-mp-rss.git
synced 2026-09-21 05:44:11 +08:00
1.4.9-Fix
This commit is contained in:
+4
-1
@@ -123,10 +123,13 @@ class Db:
|
||||
art.id=f"{str(art.mp_id)}-{art.id}".replace("MP_WXS_","") # type: ignore
|
||||
if check_exist:
|
||||
# 检查文章是否已存在
|
||||
existing_article = session.query(Article.id).filter(
|
||||
existing_article = session.query(Article.id,Article.publish_time,Article.status).filter(
|
||||
(Article.url == art.url) | (Article.id == art.id)
|
||||
).first()
|
||||
if existing_article is not None:
|
||||
# 当更新时间和状态都相同时,不需要更新
|
||||
if art.publish_time == existing_article.publish_time and art.status == existing_article.status: # type: ignore
|
||||
return False
|
||||
if art.content_html:# type: ignore
|
||||
from tools.fix import fix_html
|
||||
art.content_html = fix_html(art.content_html) # type: ignore
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ from core.models.article import Article
|
||||
|
||||
DB=db.Db(tag="文章采集API")
|
||||
|
||||
def UpdateArticle(art:dict,check_exist=False):
|
||||
def UpdateArticle(art:dict,check_exist=True):
|
||||
mps_count=0
|
||||
if DEBUG:
|
||||
# DB.delete_article(art)
|
||||
|
||||
Reference in New Issue
Block a user