Skip to content

Commit

Permalink
Handles events where fetch_songs return no results
Browse files Browse the repository at this point in the history
  • Loading branch information
tommysolsen committed Jun 15, 2017
1 parent bc87af1 commit e07a117
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions mps_youtube/commands/generate_playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ def run_m(idx):
"""
create_playlist(idx, title)

data = [listview.ListSongtitle(x) for x in data]
g.content = listview.ListView(columns, data, run_m)
g.message = util.F("mkp desc which data")
if data:
data = [listview.ListSongtitle(x) for x in data]
g.content = listview.ListView(columns, data, run_m)
g.message = util.F("mkp desc which data")
else:
g.message = util.F("mkp no valid")

return
4 changes: 3 additions & 1 deletion mps_youtube/g.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,6 @@
'mkp desc unknown': "Unknown tabletype, *do a new search*",
'mkp desc unknown_': (c.y, c.w),
'mkp desc which data': "Which *tracks* to include?",
'mkp desc which data_': (c.y, c.w)}
'mkp desc which data_': (c.y, c.w),
'mkp no valid': "*No valid tracks found in that description*",
'mkp no valid_': (c.y, c.w)}

0 comments on commit e07a117

Please sign in to comment.