update
This commit is contained in:
parent
bd7f69e14d
commit
8302339932
30
main.py
30
main.py
@ -192,22 +192,24 @@ def parse_xpi_detail(plugin: AddonInfo, release: AddonInfoRelease, release_asset
|
|||||||
xpi_filename=f'{plugin.owner}#{plugin.repository}+{release.tagName}@{release_asset["id"]}.xpi')
|
xpi_filename=f'{plugin.owner}#{plugin.repository}+{release.tagName}@{release_asset["id"]}.xpi')
|
||||||
|
|
||||||
if details and details.update_url and details.id and details.version:
|
if details and details.update_url and details.id and details.version:
|
||||||
update_json_resp = requests.get(details.update_url,
|
try:
|
||||||
headers=github_api_headers(github_token=kwargs.get('github_token')))
|
update_json_resp = requests.get(details.update_url,
|
||||||
update_json_info = json.loads(update_json_resp.content)
|
headers=github_api_headers(github_token=kwargs.get('github_token')))
|
||||||
|
update_json_info = json.loads(update_json_resp.content)
|
||||||
|
|
||||||
updates = update_json_info.get('addons', {}).get(details.id, {}).get('updates', [])
|
updates = update_json_info.get('addons', {}).get(details.id, {}).get('updates', [])
|
||||||
xpi_urls = [e.get('update_link') for e in updates if compare_versions(e.get('version'), details.version) > 0]
|
xpi_urls = [e.get('update_link') for e in updates if compare_versions(e.get('version'), details.version) > 0]
|
||||||
|
|
||||||
for xpi_url in xpi_urls:
|
for xpi_url in xpi_urls:
|
||||||
update_details = xpi_detail(xpi_url=xpi_url,
|
update_details = xpi_detail(xpi_url=xpi_url,
|
||||||
xpi_filename=f'{plugin.owner}#{plugin.repository}+update{details.version}.xpi')
|
xpi_filename=f'{plugin.owner}#{plugin.repository}+update{details.version}.xpi')
|
||||||
if update_details and update_details.check_compatible_for_zotero_version(release.zotero_check_version):
|
if update_details and update_details.check_compatible_for_zotero_version(release.zotero_check_version):
|
||||||
details = update_details
|
details = update_details
|
||||||
release.xpiDownloadUrl = {
|
release.xpiDownloadUrl = {
|
||||||
'github': xpi_url,
|
'github': xpi_url,
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
except: pass
|
||||||
return details
|
return details
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user