cc-2055: switch-to-init.d
-return proper return value when exception is raised in recorder.py
This commit is contained in:
parent
bfb5dc4e58
commit
48e05e4b7f
2 changed files with 12 additions and 14 deletions
|
@ -318,6 +318,7 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
|
||||
except Exception, e:
|
||||
logger.error("Exception: %s", e)
|
||||
response = None
|
||||
|
||||
return response
|
||||
|
||||
|
|
|
@ -166,21 +166,18 @@ class Record():
|
|||
|
||||
def get_shows(self):
|
||||
|
||||
shows = self.api_client.get_shows_to_record()
|
||||
response = self.api_client.get_shows_to_record()
|
||||
|
||||
if self.sr is not None:
|
||||
if not shows['is_recording'] and self.sr.is_recording():
|
||||
self.sr.cancel_recording()
|
||||
if response is not None and 'is_recording' in response:
|
||||
if self.sr is not None:
|
||||
if not response['is_recording'] and self.sr.is_recording():
|
||||
self.sr.cancel_recording()
|
||||
|
||||
shows = response[u'shows']
|
||||
|
||||
if shows is not None:
|
||||
shows = shows[u'shows']
|
||||
else:
|
||||
shows = []
|
||||
|
||||
if len(shows):
|
||||
self.process_shows(shows)
|
||||
self.check_record()
|
||||
if len(shows):
|
||||
self.process_shows(shows)
|
||||
self.check_record()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue