Skip to content

Commit 298768f

Browse files
committed
fix: 修复下载源添加时缺少sourceUrl字段的检查
- 在DownloadSource.add_source方法中添加对sourceUrl字段的检查 - 当source为空或缺少sourceUrl字段时返回False - 更新项目版本号至1.1.26 修复了之前版本中可能因缺少sourceUrl字段而错误添加无效源的问题。 版本更新反映了此次bug修复的发布。
1 parent 07768d3 commit 298768f

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "funread"
3-
version = "1.1.25"
3+
version = "1.1.26"
44
description = "一个用于管理和处理阅读源(Legado 阅读 APP 的书源和 RSS 源)的 Python 工具库"
55
readme = "README.md"
66
requires-python = ">=3.8"

src/funread/legado/manage/download/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def add_source(self, source: Dict[str, Any], *args, **kwargs) -> bool:
168168
是否成功添加
169169
"""
170170
try:
171-
if len(source) == 0:
171+
if len(source) == 0 or "sourceUrl" not in source:
172172
return False
173173
# 计算 MD5
174174
md5 = get_md5_str(json.dumps(source, sort_keys=True))

0 commit comments

Comments
 (0)