use repo name if xpi parsed name not found

This commit is contained in:
ytshen 2024-02-02 19:58:36 +08:00
parent a63f552bce
commit e78da5c443

View File

@ -52,8 +52,6 @@ def download_xpi(xpi_url: str, download_dir: str, unique_name: str, force_downlo
def parse(plugin, **kwargs): def parse(plugin, **kwargs):
if repo not in plugin or len(plugin[repo].split('/')) != 2 or releases not in plugin or len(plugin[releases]) <= 0: if repo not in plugin or len(plugin[repo].split('/')) != 2 or releases not in plugin or len(plugin[releases]) <= 0:
return return
if name not in plugin:
plugin[name] = plugin[repo].split('/')[-1]
headers = github_api_headers(github_token=kwargs.get('github_token')) headers = github_api_headers(github_token=kwargs.get('github_token'))
@ -185,6 +183,9 @@ def parse(plugin, **kwargs):
plugin[releases] = release_infos plugin[releases] = release_infos
if name not in plugin:
plugin[name] = plugin[repo].split('/')[-1]
return plugin return plugin