Skip to content

Commit

Permalink
flake fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kingosticks committed Feb 22, 2014
1 parent 0c68a36 commit 5edc8bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mopidy_tunein/actor.py
Expand Up @@ -49,10 +49,10 @@ def browse(self, uri):
elif variant == "section" and identifier:
if (self.backend.tunein.related(identifier)):
result.append(Ref.directory(
uri='tunein:related:%s' % identifier, name='Related'))
uri='tunein:related:%s' % identifier, name='Related'))
if (self.backend.tunein.shows(identifier)):
result.append(Ref.directory(
uri='tunein:shows:%s' % identifier, name='Shows'))
uri='tunein:shows:%s' % identifier, name='Shows'))
for station in self.backend.tunein.featured(identifier):
result.append(translator.section_to_ref(station))
for station in self.backend.tunein.local(identifier):
Expand Down
14 changes: 7 additions & 7 deletions mopidy_tunein/tunein.py
Expand Up @@ -135,11 +135,11 @@ def reload(self):

def _filter_results(self, data, section_name=None, map_func=None):
results = []

def grab_item(item):
if 'guide_id' not in item:
return
if item.get('type','link') == 'link':
if item.get('type', 'link') == 'link':
results.append(item)
return
if map_func:
Expand All @@ -148,11 +148,11 @@ def grab_item(item):
station = item
self._stations[station['guide_id']] = station
results.append(station)

for item in data:
if section_name is not None:
section_key = item.get('key', '').lower()
if section_key.startswith(section_name.lower()):
if section_key.startswith(section_name.lower()):
for child in item['children']:
grab_item(child)
else:
Expand All @@ -173,8 +173,8 @@ def categories(self, category=''):
if category in ('podcast', 'local'):
results = self._filter_results(results, '') # Flatten the results!
elif category == '':
trending = {'text': 'Trending',
'key': 'trending',
trending = {'text': 'Trending',
'key': 'trending',
'type': 'link',
'URL': self._base_uri % 'Browse.ashx?c=trending'}
# Filter out the language root category for now
Expand All @@ -188,7 +188,7 @@ def locations(self, location):
args = '&id=' + location
results = self._tunein('Browse.ashx', args)
# TODO: Support filters here
return [x for x in results if x.get('type','') == 'link']
return [x for x in results if x.get('type', '') == 'link']

def _browse(self, section_name, guide_id):
args = '&id=' + guide_id
Expand Down

0 comments on commit 5edc8bc

Please sign in to comment.