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

mpd.playlists[index].songs breaks when playlist contains non-existent file #4

Closed
kyv opened this issue Jun 7, 2013 · 2 comments · Fixed by #5
Closed

mpd.playlists[index].songs breaks when playlist contains non-existent file #4

kyv opened this issue Jun 7, 2013 · 2 comments · Fixed by #5

Comments

@kyv
Copy link
Contributor

kyv commented Jun 7, 2013

If a playlist has an internet radio or an erroneous file the .songs method throws the exception:

TypeError: no implicit conversion of Symbol into String

I would expect the the method to return a list of song objects as stated in the playlist. Perhaps some checks could be made for interet radio. Or perhaps return nil for those songs which do not exist. Or worst case provide an error indicating which playlist and file produce the error. In my case, the playlist has two good files and just one bad, and it took me a while to track down the problem.

To confirm just echo some erronous fileames or an internet radio url into an .m3u file in mpd's playlist directory and parse it with ruby-mpd. Heres the trace:

from ...gem/ruby/2.0.0/gems/ruby-mpd-0.2.2/lib/ruby-mpd/song.rb:12:in `initialize'
from ...gem/ruby/2.0.0/gems/ruby-mpd-0.2.2/lib/ruby-mpd/playlist.rb:25:in `new'
from ...gem/ruby/2.0.0/gems/ruby-mpd-0.2.2/lib/ruby-mpd/playlist.rb:25:in `block in songs'
from ...gem/ruby/2.0.0/gems/ruby-mpd-0.2.2/lib/ruby-mpd/playlist.rb:25:in `map'
from ...gem/ruby/2.0.0/gems/ruby-mpd-0.2.2/lib/ruby-mpd/playlist.rb:25:in `songs'
@archseer
Copy link
Owner

archseer commented Jun 7, 2013

I'll look into it this weekend, don't have much time today. Or you can look into it, if you wish?

@kyv
Copy link
Contributor Author

kyv commented Jun 7, 2013

I will investigate further, but any help is appreciated.

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

Successfully merging a pull request may close this issue.

2 participants