From a23319bf00068e2f47191b41a80f448d0288ab25 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Thu, 17 Oct 2013 11:25:35 +0100 Subject: [PATCH] Add queue endpoint. --- mpd_client.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mpd_client.rb b/mpd_client.rb index 2e51764..47d73b8 100644 --- a/mpd_client.rb +++ b/mpd_client.rb @@ -7,6 +7,7 @@ require 'cgi' require './models/album' require './models/artist' +require './models/song' class MPDClient < Sinatra::Base register Sinatra::Namespace @@ -33,6 +34,10 @@ class MPDClient < Sinatra::Base JSON Artist.all.map(&:to_h) end + get '/queue' do + JSON Song.queue.map(&:to_h) + end + end end