Added label to json
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Fetch Nintendo Switch firmware release metadata from THZoria/NX_Firmware via the GitHub API
|
||||
and write a JSON list of {tag, download} for each release that has a .zip asset.
|
||||
and write a JSON list of {tag, label, download} for each release that has a .zip asset.
|
||||
|
||||
Example:
|
||||
python3 generate_nx_firmware_json.py
|
||||
python3 generate_nx_firmware_json.py -o archive.json --min 18.0.0
|
||||
python3 generate_fw_archive.py
|
||||
python3 generate_fw_archive.py -o archive.json --min 18.0.0
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -93,7 +93,9 @@ def build_entries(
|
||||
url = pick_zip_url(rel.get("assets") or [])
|
||||
if not url:
|
||||
continue
|
||||
out.append({"tag": tag, "download": url})
|
||||
name = str(rel.get("name") or "").strip()
|
||||
label = name if name else f"Firmware {tag}"
|
||||
out.append({"tag": tag, "label": label, "download": url})
|
||||
|
||||
out.sort(key=lambda e: parse_fw_tag(e["tag"]) or (0, 0, 0), reverse=True)
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user