mirror of
https://github.com/lilydjwg/nvchecker
synced 2025-02-17 11:07:27 +00:00
update sparkle
This commit is contained in:
parent
f8dd1a4212
commit
46d724b465
@ -13,19 +13,6 @@ async def get_version(name, conf, *, cache, **kwargs):
|
||||
async def get_version_impl(sparkle):
|
||||
res = await session.get(sparkle)
|
||||
root = ElementTree.fromstring(res.body)
|
||||
item = root.find('./channel/item[1]/enclosure')
|
||||
version = root.find('./channel/item[1]/{http://www.andymatuschak.org/xml-namespaces/sparkle}version')
|
||||
|
||||
version_string = item.get('{http://www.andymatuschak.org/xml-namespaces/sparkle}shortVersionString')
|
||||
build_number = item.get('{http://www.andymatuschak.org/xml-namespaces/sparkle}version')
|
||||
|
||||
if (version_string and version_string.isdigit()) and (build_number and not build_number.isdigit()):
|
||||
version_string, build_number = build_number, version_string
|
||||
|
||||
version = []
|
||||
|
||||
if version_string:
|
||||
version.append(version_string)
|
||||
if build_number and (build_number not in version):
|
||||
version.append(build_number)
|
||||
|
||||
return '-'.join(version) if version else None
|
||||
return version.text
|
||||
|
Loading…
Reference in New Issue
Block a user