archseer / ruby-mpd

ruby-mpd is a powerful object-oriented Music Player Daemon library, forked from librmpd.
GNU General Public License v2.0
83 stars 32 forks source link

Detect invalid songs #51

Open Phrogz opened 8 years ago

Phrogz commented 8 years ago
  1. Create a playlist and add a song to it.
  2. Remove that song from the MPD library.
  3. Load the playlist.

The playlist now has a song with a file but no other data. How can I detect if this is a valid song with no metadata, or an invalid song?

I'm currently using the heuristic of checking to see if song.time.nil?. It would be nice to have something like MPD::Song#valid? to see if the song instance is grounded in reality and able to be used.