Added error reporting to script downloads, errors do not stop scripts

This commit is contained in:
2024-12-19 20:16:15 -05:00
parent 31f47f2acd
commit 2142dbad7e
3 changed files with 90 additions and 28 deletions

View File

@@ -3,6 +3,7 @@
import requests
from dataclasses import dataclass
from typing import List
@dataclass
@@ -27,6 +28,14 @@ class BatchTitleData:
archive_name: str
@dataclass
class BatchResults:
# Class to store the results of a batch download.
code: int
warning_titles: List[str]
failed_titles: List[str]
def check_nusget_updates(app, current_version: str, progress_callback=None) -> str | None:
# Simple function to make a request to the GitHub API and then check if the latest available version is newer.
gh_api_request = requests.get(url="https://api.github.com/repos/NinjaCheetah/NUSGet/releases/latest", stream=True)