Skip to content

Commit

Permalink
replaced filter to list comprehensions
Browse files Browse the repository at this point in the history
  • Loading branch information
pablouser1 committed Dec 29, 2023
1 parent 5a54ff9 commit d8529f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/lib/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def search(self, term: str)-> list:
})

# Return only allowed items (tvshows, movies...)
return filter(lambda item: 'type' in item, res['data'])
return [item for item in res['data'] if 'type' in item]

def purchased(self)-> list:
res = self.makeRequest(endpoint='/user/purchased/medias')
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/player/Handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def versionPicker(self)-> dict:
"""
versions_api = self.item['versions']['data']
# Exclude offline versions
versions_filtered = list(filter(lambda version: not version['offline'], versions_api))
versions_filtered = [version for version in versions_api if not version['offline']]
versions_show = []
for version_temp in versions_filtered:
label = '{0} - {1}'.format(version_temp['name'], version_temp['rightType']['name'])
Expand Down

0 comments on commit d8529f2

Please sign in to comment.