Browse files

flake fixes

  • Loading branch information...
1 parent 0c68a36 commit 5edc8bc61b7e1f1d4dfbb98cd1b33e063f5d64d1 @kingosticks committed Feb 22, 2014
Showing with 9 additions and 9 deletions.
  1. +2 −2 mopidy_tunein/actor.py
  2. +7 −7 mopidy_tunein/tunein.py
View
4 mopidy_tunein/actor.py
@@ -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):
View
14 mopidy_tunein/tunein.py
@@ -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:
@@ -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:
@@ -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
@@ -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

0 comments on commit 5edc8bc

Please sign in to comment.