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

@@ -2065,7 +2065,7 @@ class ModelLibraryHandler:
file_path=file_path if isinstance(file_path, str) else None,
)
else:
await history_service.mark_not_downloaded(model_type, model_version_id)
await history_service.mark_as_deleted(model_type, model_version_id)
return web.json_response(
{
@@ -2151,7 +2151,7 @@ class ModelLibraryHandler:
await persist()
history_service = await self._get_download_history_service()
await history_service.mark_not_downloaded(found_type, model_version_id)
await history_service.mark_as_deleted(found_type, model_version_id)
return web.json_response(
{