df
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
This commit is contained in:
@@ -373,6 +373,29 @@ class HydrusNetwork:
|
||||
body = {"hashes": hash_list}
|
||||
return self._post("/add_files/undelete_files", data=body)
|
||||
|
||||
def delete_files(self, hashes: Union[str, Iterable[str]], *, reason: str | None = None) -> dict[str, Any]:
|
||||
"""Delete files in Hydrus.
|
||||
|
||||
Hydrus Client API: POST /add_files/delete_files
|
||||
Required JSON args: {"hashes": [<sha256 hex>, ...]}
|
||||
Optional JSON args: {"reason": "..."}
|
||||
"""
|
||||
hash_list = self._ensure_hashes(hashes)
|
||||
body: dict[str, Any] = {"hashes": hash_list}
|
||||
if isinstance(reason, str) and reason.strip():
|
||||
body["reason"] = reason.strip()
|
||||
return self._post("/add_files/delete_files", data=body)
|
||||
|
||||
def clear_file_deletion_record(self, hashes: Union[str, Iterable[str]]) -> dict[str, Any]:
|
||||
"""Clear Hydrus's file deletion record for the provided hashes.
|
||||
|
||||
Hydrus Client API: POST /add_files/clear_file_deletion_record
|
||||
Required JSON args: {"hashes": [<sha256 hex>, ...]}
|
||||
"""
|
||||
hash_list = self._ensure_hashes(hashes)
|
||||
body = {"hashes": hash_list}
|
||||
return self._post("/add_files/clear_file_deletion_record", data=body)
|
||||
|
||||
def add_tag(self, hash: Union[str, Iterable[str]], tags: Iterable[str], service_name: str) -> dict[str, Any]:
|
||||
hash = self._ensure_hashes(hash)
|
||||
body = {"hashes": hash, "service_names_to_tags": {service_name: list(tags)}}
|
||||
|
||||
Reference in New Issue
Block a user