feat: copy the latest plugin release URL from the panel; release 0.1.2
ysj7705/mudfish-decky/pipeline/head This commit looks good
ysj7705/mudfish-decky/pipeline/head This commit looks good
Advanced shows the installed plugin version and the latest Gitea release. '최신 플러그인 주소 복사' puts the release zip URL on the clipboard for Decky's Install Plugin from URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
371f5a3814
commit
d9015d43b9
6 files changed
+99
-2
No files matched your search
@@ -0,0 +1,29 @@
|
||||
"""Where to get this plugin's newest build: the latest Gitea release's zip (for Decky's Install from URL)."""
|
||||
import json
|
||||
import logging
|
||||
import urllib.request
|
||||
from typing import Optional
|
||||
|
||||
from .client import ssl_context
|
||||
|
||||
LATEST_RELEASE_API = "https://git.sejong.dev/api/v1/repos/ysj7705/mudfish-decky/releases/latest"
|
||||
|
||||
log = logging.getLogger("mudfish_decky")
|
||||
|
||||
|
||||
def _fetch(url: str) -> str:
|
||||
with urllib.request.urlopen(url, timeout=10, context=ssl_context()) as resp:
|
||||
return resp.read().decode()
|
||||
|
||||
|
||||
def latest_plugin_release(fetch=_fetch) -> Optional[dict]:
|
||||
"""{'version': '0.1.2', 'url': <zip download URL>} or None when offline or no zip is attached."""
|
||||
try:
|
||||
release = json.loads(fetch(LATEST_RELEASE_API))
|
||||
except Exception as e:
|
||||
log.warning("plugin release lookup failed: %s", e)
|
||||
return None
|
||||
zips = [a for a in release.get("assets", []) if a.get("name", "").endswith(".zip")]
|
||||
if not zips:
|
||||
return None
|
||||
return {"version": release.get("tag_name", "").lstrip("v"), "url": zips[0]["browser_download_url"]}
|
||||
Reference in new issue
Block a user