2021-07-14 12:05:45 +00:00
|
|
|
# MIT licensed
|
|
|
|
# Copyright (c) 2013-2021 Th3Whit3Wolf <the.white.wolf.is.1337@gmail.com>, et al.
|
|
|
|
|
2023-10-18 00:00:46 +00:00
|
|
|
from nvchecker.api import RichResult
|
|
|
|
|
2021-07-14 12:05:45 +00:00
|
|
|
API_URL = 'https://open-vsx.org/api/%s/%s'
|
|
|
|
|
|
|
|
async def get_version(name, conf, *, cache, **kwargs):
|
|
|
|
name = conf.get('openvsx') or name
|
|
|
|
splitName = name.split('.')
|
|
|
|
publisher = splitName[0]
|
|
|
|
extension = splitName[1]
|
|
|
|
data = await cache.get_json(API_URL % (publisher, extension))
|
|
|
|
version = data['version']
|
2023-10-18 00:00:46 +00:00
|
|
|
return RichResult(
|
|
|
|
version = version,
|
|
|
|
url = f'https://open-vsx.org/extension/{publisher}/{extension}/{version}',
|
|
|
|
)
|