Change endpoint to btclock git
This commit is contained in:
parent
7dfed6af6c
commit
c820fb9421
1 changed files with 4 additions and 4 deletions
|
@ -11,7 +11,7 @@ from app.utils import get_app_data_folder, keep_latest_versions
|
||||||
CACHE_FILE = get_app_data_folder() + '/cache.json'
|
CACHE_FILE = get_app_data_folder() + '/cache.json'
|
||||||
CACHE_DURATION = timedelta(minutes=30)
|
CACHE_DURATION = timedelta(minutes=30)
|
||||||
|
|
||||||
LATEST_RELEASE_ENDPOINT = "https://git.rof.tools/api/v1/repos/mirrors/btclock_v3/tags"
|
LATEST_RELEASE_ENDPOINT = "https://git.btclock.dev/api/v1/repos/btclock/btclock_v3/tags"
|
||||||
|
|
||||||
class ReleaseChecker:
|
class ReleaseChecker:
|
||||||
'''Release Checker for firmware updates'''
|
'''Release Checker for firmware updates'''
|
||||||
|
@ -35,7 +35,7 @@ class ReleaseChecker:
|
||||||
|
|
||||||
def fetch_latest_release(self):
|
def fetch_latest_release(self):
|
||||||
'''Fetch latest firmware release from GitHub'''
|
'''Fetch latest firmware release from GitHub'''
|
||||||
repo = "mirrors/btclock_v3"
|
repo = "btclock/btclock_v3"
|
||||||
cache = self.load_cache()
|
cache = self.load_cache()
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class ReleaseChecker:
|
||||||
latest_release = cache['latest_release']['data']
|
latest_release = cache['latest_release']['data']
|
||||||
else:
|
else:
|
||||||
# url = f"https://api.github.com/repos/{repo}/releases/latest"
|
# url = f"https://api.github.com/repos/{repo}/releases/latest"
|
||||||
url = f"https://git.rof.tools/api/v1/repos/{repo}/releases/latest"
|
url = f"https://git.btclock.dev/api/v1/repos/{repo}/releases/latest"
|
||||||
try:
|
try:
|
||||||
response = requests.get(url)
|
response = requests.get(url)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
|
@ -74,7 +74,7 @@ class ReleaseChecker:
|
||||||
for asset_url in asset_urls:
|
for asset_url in asset_urls:
|
||||||
self.download_file(asset_url, release_name)
|
self.download_file(asset_url, release_name)
|
||||||
|
|
||||||
ref_url = f"https://git.rof.tools/api/v1/repos/{repo}/tags/{release_name}"
|
ref_url = f"https://git.btclock.dev/api/v1/repos/{repo}/tags/{release_name}"
|
||||||
#ref_url = f"https://api.github.com/repos/{
|
#ref_url = f"https://api.github.com/repos/{
|
||||||
# repo}/git/ref/tags/{release_name}"
|
# repo}/git/ref/tags/{release_name}"
|
||||||
if ref_url in cache and (now - datetime.fromisoformat(cache[ref_url]['timestamp'])) < CACHE_DURATION:
|
if ref_url in cache and (now - datetime.fromisoformat(cache[ref_url]['timestamp'])) < CACHE_DURATION:
|
||||||
|
|
Loading…
Reference in a new issue