commit
6d48e275a8
@ -18,6 +18,7 @@ id = "id"
|
||||
xpiVersion = "xpiVersion"
|
||||
description = "description"
|
||||
star = "star"
|
||||
stars = "stars"
|
||||
author = "author"
|
||||
url = "url"
|
||||
avatar = "avatar"
|
||||
@ -67,7 +68,7 @@ avatar = "avatar"
|
||||
# }>;
|
||||
#
|
||||
# description?: string;
|
||||
# star?: number;
|
||||
# stars?: number;
|
||||
# author?: {
|
||||
# name: string;
|
||||
# url: string;
|
||||
|
||||
@ -2,10 +2,6 @@
|
||||
"name": "Night for Zotero",
|
||||
"repo": "tefkah/zotero-night",
|
||||
"releases": [
|
||||
{
|
||||
"targetZoteroVersion": "7",
|
||||
"tagName": "pre"
|
||||
},
|
||||
{
|
||||
"targetZoteroVersion": "6",
|
||||
"tagName": "latest"
|
||||
|
||||
4
main.py
4
main.py
@ -80,6 +80,8 @@ def parse(plugin, **kwargs):
|
||||
if repos_info['description'] and description not in plugin:
|
||||
plugin[description] = repos_info['description']
|
||||
if repos_info['stargazers_count'] is not None:
|
||||
plugin[stars] = repos_info['stargazers_count']
|
||||
# todo: remove
|
||||
plugin[star] = repos_info['stargazers_count']
|
||||
except Exception as e:
|
||||
print(f'request {repo_url} failed: {e}')
|
||||
@ -224,7 +226,7 @@ def parse_addon_infos(input_dir, output_filepath, **kwargs):
|
||||
for previous_info_url in kwargs.get('previous_info_urls', []):
|
||||
addon_infos = fallback(addon_infos, previous_info_url, github_token=kwargs.get('github_token'))
|
||||
|
||||
addon_infos.sort(key=lambda item: item[star] if star in item else 0, reverse=True)
|
||||
addon_infos.sort(key=lambda item: item[stars] if stars in item else 0, reverse=True)
|
||||
|
||||
dir = os.path.dirname(output_filepath)
|
||||
if dir and not os.path.exists(dir):
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import zipfile
|
||||
import json
|
||||
import commentjson as json
|
||||
import os
|
||||
from xml.dom import minidom
|
||||
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
requests
|
||||
argparse
|
||||
commentjson
|
||||
Loading…
Reference in New Issue
Block a user