Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle entering an artist without a song #5

Open
xaionaro opened this issue Mar 6, 2017 · 5 comments
Open

Handle entering an artist without a song #5

xaionaro opened this issue Mar 6, 2017 · 5 comments

Comments

@xaionaro
Copy link

xaionaro commented Mar 6, 2017

Hello. I'm getting error "IndexError: list index out of range"

$ playlistfromsong -s 'Kalya Scintilla'

PLAYLIST: 

Desert Dwellers - Lotus Heart - (Kalya Scintilla Remix)
Kalya Scintilla - Kalya Scintilla
Kaya Project - Kaya Project
Androcell - Androcell
Kaminanda - Kaminanda
Ott - Ott
Shulman - Shulman
Bluetech - Bluetech
Shakatura - Shakatura
Hibernation - Hibernation
Desert Dwellers - Desert Dwellers
Master Minded - Master Minded
Kalya Scintilla -  similar
Kaya Project -  similar
Angel Tears - Angel Tears
Random Rab - Random Rab
Entheogenic - Entheogenic
Tripswitch - Tripswitch
Androcell -  similar
Kaminanda -  similar
Akasha - Akasha
Cell - Cell
Younger Brother - Younger Brother
Digital Mystery Tour - Digital Mystery Tour
Traceback (most recent call last):
  File "/usr/local/bin/playlistfromsong", line 9, in <module>
    load_entry_point('playlistfromsong==0.12', 'console_scripts', 'playlistfromsong')()
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/__main__.py", line 213, in main
    youtubeLinks = useLastFM(song, num)
  File "/usr/local/lib/python2.7/dist-packages/playlistfromsong/__main__.py", line 140, in useLastFM
    for data in p.map(getYoutubeAndRelatedLastFMTracks, lastfmTracks):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
    raise self._value
IndexError: list index out of range

$ python --version
Python 2.7.9

Best regards, Dmitry.

schollz added a commit that referenced this issue Mar 6, 2017
@schollz
Copy link
Owner

schollz commented Mar 6, 2017

Yeah, I see its having a problem because you entered an artist and not an artist+song. The program is capturing similar artists when it thinks its capturing similar tracks. I will try to fix this in the future, but for the present try this:

$ playlistfromsong -s 'Kalya Scintilla Rises in the East'

@schollz schollz changed the title IndexError: list index out of range Handle entering an artist without a song Mar 6, 2017
@schollz schollz added the bug label Mar 6, 2017
@xaionaro
Copy link
Author

xaionaro commented Mar 6, 2017

Ok. I created the issue because I just expected a human readable error instead of a backtrace :)

It's not a problem as for me and thank you for this utility. I just reported a thing that I considered as an UX-problem :)

@syc728
Copy link

syc728 commented Oct 5, 2017

@schollz I see there is an argument num to control the length of the generated playlist with default value 3, so I do not get the same error.
What i need to do is to add some readable descriptions, is it correct?

@schollz
Copy link
Owner

schollz commented Oct 5, 2017

@syc728 Actually the problem is that sometimes a user might enter an artist and not a song. I think what needs to happen is that the closest match to the user input should be relayed back to the user.

For instance:

$ playlistfromsong -s 'Tom Petty'
Did you mean "Tom Petty - Refugee"? (y/n)

This can be the default behavior, actually, so that if someone does type a song it will still ask if that is the one that they meant:

$ playlistfromsong -s 'Led Zeppelin - Stairway to heaven'
Did you mean "Led Zeppelin - Stairway To Heaven"? (y/n)

If the user says "y" then it proceeds normally. If the user says "n" then it asks the user to retype the artist name + song name.

The functionality for finding the first seed song is already done, so it just needs to prompt the user to check to make sure it is correct.

@syc728
Copy link

syc728 commented Oct 5, 2017

@schollz Oh I got it! I will work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants