updated plugin refactor and added FTP and SCP plugins , also hydrusnetwork plugin migration

This commit is contained in:
2026-04-27 21:17:53 -07:00
parent bfd5c20dc3
commit 8685fbb723
24 changed files with 3650 additions and 405 deletions
+29
View File
@@ -89,6 +89,8 @@ class HydrusNetwork(Store):
Maintains its own HydrusClient.
"""
STORE_TYPE = "hydrusnetwork"
@classmethod
def config_schema(cls) -> List[Dict[str, Any]]:
return [
@@ -1776,6 +1778,33 @@ class HydrusNetwork(Store):
debug(f"{self._log_prefix()} delete_file failed: {exc}")
return False
def build_file_url(self, file_hash: str, *, include_access_key: bool = True) -> str:
normalized = str(file_hash or "").strip().lower()
base_url = str(self.URL).rstrip("/")
url = f"{base_url}/get_files/file?hash={quote(normalized)}"
if include_access_key and str(self.API or "").strip():
url = f"{url}&Hydrus-Client-API-Access-Key={quote(str(self.API))}"
return url
def fetch_file_metadata(self, file_hash: str, **kwargs: Any) -> Optional[Dict[str, Any]]:
try:
client = self._client
if client is None:
return None
return client.fetch_file_metadata(hashes=[str(file_hash or "").strip().lower()], **kwargs)
except Exception:
return None
def get_relationships(self, file_hash: str) -> Optional[Dict[str, Any]]:
try:
client = self._client
if client is None:
return None
payload = client.get_file_relationships(str(file_hash or "").strip().lower())
return payload if isinstance(payload, dict) else None
except Exception:
return None
def get_metadata(self, file_hash: str, **kwargs: Any) -> Optional[Dict[str, Any]]:
"""Get metadata for a file from Hydrus by hash.