Skip to content

Commit

Permalink
Merge pull request #42 from lrusak/libreelec-7.0
Browse files Browse the repository at this point in the history
fix blank system screen when no network is present
  • Loading branch information
chewitt authored Dec 7, 2016
2 parents 0fa8795 + ff4ea63 commit f5c35ff
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/resources/lib/modules/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,11 @@ def get_channels(self):
try:
self.oe.dbg_log('system::get_channels', 'enter_function', 0)
channels = []
for channel in self.update_json:
channels.append(channel)
return channels
if not self.update_json is None:
for channel in self.update_json:
channels.append(channel)
self.oe.dbg_log('system::get_channels', 'exit_function', 0)
return channels
except Exception, e:
self.oe.dbg_log('system::get_channels', 'ERROR: (' + repr(e) + ')')

Expand Down Expand Up @@ -582,7 +583,11 @@ def get_json(self):
try:
self.oe.dbg_log('system::get_json', 'enter_function', 0)
url = self.UPDATE_DOWNLOAD_URL % ('releases', 'releases.json')
update_json = json.loads(self.oe.load_url(url))
data = self.oe.load_url(url)
if not data is None:
update_json = json.loads(data)
else:
update_json = None
return update_json
self.oe.dbg_log('system::get_json', 'exit_function', 0)
except Exception, e:
Expand All @@ -593,13 +598,13 @@ def get_available_builds(self):
self.oe.dbg_log('system::get_available_builds', 'enter_function', 0)
channel = self.struct['update']['settings']['Channel']['value']
update_files = []
if channel != '':
if channel in self.update_json:
for i in self.update_json[channel]['project'][self.oe.ARCHITECTURE]['releases']:
update_files.append(self.update_json[channel]['project'][self.oe.ARCHITECTURE]['releases'][i]['file']['name'])

return update_files
if not self.update_json is None:
if channel != '':
if channel in self.update_json:
for i in self.update_json[channel]['project'][self.oe.ARCHITECTURE]['releases']:
update_files.append(self.update_json[channel]['project'][self.oe.ARCHITECTURE]['releases'][i]['file']['name'])
self.oe.dbg_log('system::get_available_builds', 'exit_function', 0)
return update_files
except Exception, e:
self.oe.dbg_log('system::get_available_builds', 'ERROR: (' + repr(e) + ')')

Expand Down

0 comments on commit f5c35ff

Please sign in to comment.