The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
refactor(relink): canRelinkToOtherFile 改名为 canRelinkToOtherContent
XiaoYouChR235136c532b7
diff --git a/app/i18n.py b/app/i18n.pyindex 1f432049..fe6b504d 100644--- a/app/i18n.py+++ b/app/i18n.py@@ -37,4 +37,4 @@ N("TaskErrors", "端口 {port} 被占用,请更换端口")N("TaskErrors", "没有权限监听端口 {port},请更换端口")N("TaskErrors", "无法监听端口 {port},详情见日志")N("TaskErrors", "该链接不能用于更换")-N("TaskErrors", "新链接与原链接不是同一个文件")+N("TaskErrors", "新链接的内容与原任务不同,请重新添加任务")diff --git a/app/models/task.py b/app/models/task.pyindex 055aa0c7..2f8d854d 100644--- a/app/models/task.py+++ b/app/models/task.py@@ -212,7 +212,7 @@ class Task:fileType: ClassVar[type] = TaskFilehasOutputFile: ClassVar[bool] = TruecanSeed: ClassVar[bool] = False- canRelinkToOtherFile: ClassVar[bool] = True+ canRelinkToOtherContent: ClassVar[bool] = Truedef __init_subclass__(cls, **kwargs):super().__init_subclass__(**kwargs)diff --git a/app/view/dialogs/edit_task.py b/app/view/dialogs/edit_task.pyindex 37450a0c..7eefc26f 100644--- a/app/view/dialogs/edit_task.py+++ b/app/view/dialogs/edit_task.py@@ -102,8 +102,8 @@ class LiveEditDialog(EditTaskDialog):super().accept()return- if not self._task.canRelinkToOtherFile:- self._onReparseFailed(TaskError("新链接与原链接不是同一个文件"))+ if not self._task.canRelinkToOtherContent:+ self._onReparseFailed(TaskError("新链接的内容与原任务不同,请重新添加任务"))returnreceivedBytes = self._task.currentSnapshot()[2]diff --git a/features/zip_pack/task.py b/features/zip_pack/task.pyindex 9a08a3b2..e6c00bb5 100644--- a/features/zip_pack/task.py+++ b/features/zip_pack/task.py@@ -27,7 +27,7 @@ class ZipEntry(TaskFile):class ZipTask(Task):packId: str = "zip"canEdit = True- canRelinkToOtherFile = False+ canRelinkToOtherContent = FalsefileType = ZipEntrytailOffset: int = 0metadataEncoding: str = ""diff --git a/tests/zip_pack/test_task.py b/tests/zip_pack/test_task.pyindex 1563d636..e9453ec7 100644--- a/tests/zip_pack/test_task.py+++ b/tests/zip_pack/test_task.py@@ -264,4 +264,4 @@ async def test_probe_other_archive_cannot_relink(features, startServer):probed = await features.probe(TaskOptions(url=await startArchive(startServer, buildArchive({"b.txt": b"b"}))))assert not task.canReuseProgress(probed)- assert not task.canRelinkToOtherFile+ assert not task.canRelinkToOtherContent