From 71e689a880229583b48bd13ae876230d93f7e78d Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Fri, 18 Oct 2013 13:30:28 +0100 Subject: [PATCH] Change 'current' to 'playing'. --- assets/css/queue.css.sass | 2 +- models/song.rb | 9 +++++---- views/index.erb | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/assets/css/queue.css.sass b/assets/css/queue.css.sass index 6d80b9c..523889e 100644 --- a/assets/css/queue.css.sass +++ b/assets/css/queue.css.sass @@ -1,2 +1,2 @@ -#queue .current +#queue .playing font-weight: bold diff --git a/models/song.rb b/models/song.rb index e6da89a..2a78f5b 100644 --- a/models/song.rb +++ b/models/song.rb @@ -1,17 +1,18 @@ require './models/mpd_connection' -class Song < Struct.new(:artist, :album, :title, :current) +class Song < Struct.new(:id, :artist, :album, :title, :playing) - def initialize(song, current: false) + def initialize(song, playing: false) @song = song + self.id = song.songid self.artist = song.artist self.album = song.album self.title = song.title - self.current = current + self.playing = playing end def self.queue current_song = MPDConnection.mpd.status[:songid] - MPDConnection.mpd.queue.map { |song| self.new(song, current: (song.id == current_song)) } + MPDConnection.mpd.queue.map { |song| self.new(song, playing: (song.id == current_song)) } end end diff --git a/views/index.erb b/views/index.erb index 43d59f8..96b1db0 100644 --- a/views/index.erb +++ b/views/index.erb @@ -17,7 +17,9 @@

Queue