refactor(download-history): rename mark_not_downloaded to mark_as_deleted

The method mark_not_downloaded() was misleading — it doesn't negate
'downloaded' history (the model was indeed downloaded before), but
rather sets is_deleted_override = 1 to indicate the version was
downloaded and subsequently deleted. This flag allows re-download when
the 'skip previously downloaded' setting is enabled.

Rename to mark_as_deleted() to accurately reflect its semantics.
This commit is contained in:
Will Miao
2026-05-12 22:50:30 +08:00
parent b4f7dd75af
commit 5c53968caa
5 changed files with 6 additions and 6 deletions

View File

@@ -30,7 +30,7 @@ async def test_download_history_roundtrip_and_manual_override(tmp_path: Path) ->
assert await service.has_been_downloaded("lora", 101) is True
assert await service.get_downloaded_version_ids("lora", 11) == [101]
await service.mark_not_downloaded("lora", 101)
await service.mark_as_deleted("lora", 101)
assert await service.has_been_downloaded("lora", 101) is False
assert await service.get_downloaded_version_ids("lora", 11) == []