Skip to content

Commit

Permalink
Fix Official Releases
Browse files Browse the repository at this point in the history
loop from LibreELEC-7.0 to the last version group
  • Loading branch information
ManuStrozor committed May 29, 2018
1 parent 1d5da15 commit a51523b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions resources/lib/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def __iter__(self):
html = self._text()

self.build_re = re.compile(
self.BUILD_RE.format(dist=libreelec.OS_RELEASE['NAME'], arch=config.arch),
self.BUILD_RE.format(dist=libreelec.name(), arch=config.arch),
re.I)

soup = BeautifulSoup(html, 'html.parser',
Expand All @@ -206,10 +206,14 @@ class ReleaseLinkExtractor(BaseExtractor):
def __iter__(self):
base_url = "http://releases.libreelec.tv"
json = self._json()
if libreelec.release() not in json:
return
releases = json[libreelec.release()]['project'][config.arch]['releases']
for release in releases.itervalues():
i = 7.0
releases = []
while "{0}-{1}".format(libreelec.name(), i) in json:
rels = json["{0}-{1}".format(libreelec.name(), i)]['project'][config.arch]['releases']
for rel in rels.itervalues():
releases.append(rel)
i += 1
for release in releases:
filename = release['file']['name']
release_name = re.search('-([\d\.]+).tar', filename).group(1)
release_link = ReleaseLink(base_url, filename, release_name)
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/libreelec.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@


def release():
dist = OS_RELEASE['NAME']
return "{name}-{version}".format(name=dist,
version=OS_RELEASE['VERSION_ID'])
return "{name}-{version}".format(name=OS_RELEASE['NAME'], version=OS_RELEASE['VERSION_ID'])

def name():
return OS_RELEASE['NAME']

def mount_readwrite():
subprocess.check_call(['mount', '-o', 'rw,remount', '/flash'])
Expand Down

0 comments on commit a51523b

Please sign in to comment.