mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-27 01:57:33 +00:00
Fixed update mechanism to store bazarr.zip asset download url (if available) instead of zipball.
This commit is contained in:
parent
7770d9c618
commit
4bc379fabc
1 changed files with 7 additions and 1 deletions
|
@ -29,11 +29,17 @@ def check_releases():
|
||||||
logging.exception("Error trying to get releases from Github.")
|
logging.exception("Error trying to get releases from Github.")
|
||||||
else:
|
else:
|
||||||
for release in r.json():
|
for release in r.json():
|
||||||
|
download_link = None
|
||||||
|
for asset in release['assets']:
|
||||||
|
if asset['name'] == 'bazarr.zip':
|
||||||
|
download_link = asset['browser_download_url']
|
||||||
|
if not download_link:
|
||||||
|
download_link = release['zipball_url']
|
||||||
releases.append({'name': release['name'],
|
releases.append({'name': release['name'],
|
||||||
'body': release['body'],
|
'body': release['body'],
|
||||||
'date': release['published_at'],
|
'date': release['published_at'],
|
||||||
'prerelease': release['prerelease'],
|
'prerelease': release['prerelease'],
|
||||||
'download_link': release['zipball_url']})
|
'download_link': download_link})
|
||||||
with open(os.path.join(args.config_dir, 'config', 'releases.txt'), 'w') as f:
|
with open(os.path.join(args.config_dir, 'config', 'releases.txt'), 'w') as f:
|
||||||
json.dump(releases, f)
|
json.dump(releases, f)
|
||||||
logging.debug('BAZARR saved {} releases to releases.txt'.format(len(r.json())))
|
logging.debug('BAZARR saved {} releases to releases.txt'.format(len(r.json())))
|
||||||
|
|
Loading…
Reference in a new issue