Compare commits

..

4 Commits

Author SHA1 Message Date
xiaoQQya
e274f8d2d0
Merge 78581b15a7 into 6f9b009194 2025-08-23 11:49:14 +08:00
xiaoQQya
6f9b009194
🐛 修复资源发布时间时区错误问题 (#114)
Some checks are pending
Docker Publish / build-and-push (push) Waiting to run
2025-08-22 21:08:50 +08:00
Cp0204
de37c26423 前端搜索过滤如 (2025) 的年份字符 2025-08-22 19:43:07 +08:00
Cp0204
e975b2822b CS 搜索增加发布时间信息,并统一格式 2025-08-22 19:28:38 +08:00
3 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,4 @@
from datetime import datetime, timedelta
import re
import requests
@ -124,6 +125,11 @@ class CloudSaver:
content = content.replace('<mark class="highlight">', "")
content = content.replace("</mark>", "")
content = content.strip()
# 统一发布时间格式
pubdate = item.get("pubDate", "")
if pubdate:
utc_tm = datetime.fromisoformat(pubdate)
pubdate = (utc_tm + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
# 链接去重
if link.get("link") not in link_array:
link_array.append(link.get("link"))
@ -132,6 +138,7 @@ class CloudSaver:
"shareurl": link.get("link"),
"taskname": title,
"content": content,
"datetime": pubdate,
"tags": item.get("tags", []),
"channel": item.get("channel", ""),
"channel_id": item.get("channelId", ""),

View File

@ -1,5 +1,5 @@
import re
import datetime
from datetime import datetime, timedelta
import requests
@ -60,7 +60,8 @@ class PanSou:
note = channel.get("note", "")
tm = channel.get("datetime", "")
if tm:
tm = datetime.datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ").strftime("%Y-%m-%d %H:%M:%S")
utc_tm = datetime.strptime(tm, "%Y-%m-%dT%H:%M:%SZ")
tm = (utc_tm + timedelta(hours=8)).strftime("%Y-%m-%d %H:%M:%S")
match = re.search(pattern, note)
if match:

View File

@ -955,6 +955,7 @@
}
},
searchSuggestions(index, taskname, deep = 1) {
taskname = taskname.replace(/\((19|20)\d{2}\)/g, '').trim();
if (taskname.length < 2) {
console.log(`任务名[${taskname}]过短${taskname.length} 不进行搜索`);
return;