diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-09 09:00:47 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-09 09:00:47 +0000 |
commit | f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61 (patch) | |
tree | 97952ac522a9f0376623e5aa868141e5d9b3a821 /lib/class/localplay.class.php | |
parent | 78590d7d512ada604987fdcc9c31a8c74591f64b (diff) | |
download | ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.tar.gz ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.tar.bz2 ampache-f79a2489c1f18f2bf1436fa5ec4c8fd9c903fd61.zip |
updates, ajax kind of broken right now its late
Diffstat (limited to 'lib/class/localplay.class.php')
-rw-r--r-- | lib/class/localplay.class.php | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/class/localplay.class.php b/lib/class/localplay.class.php index b9f0d8cc..48097882 100644 --- a/lib/class/localplay.class.php +++ b/lib/class/localplay.class.php @@ -534,7 +534,7 @@ class Localplay { * of the current player state */ function get_user_state($state) { - + switch ($state) { case 'play': return _('Now Playing'); @@ -552,6 +552,29 @@ class Localplay { } // get_user_state + /** + * get_user_playing + * This attempts to return a nice user friendly + * currently playing string + */ + function get_user_playing() { + + $status = $this->status(); + + /* Format the track name */ + $track_name = $status['track_artist'] . ' - ' . $status['track_album'] . ' - ' . $status['track_title']; + + /* This is a cheezball fix for when we were unable to find a + * artist/album (or one wasn't provided) + */ + $track_name = ltrim(ltrim($track_name,' - '),' - '); + + $track_name = "[" . $status['track'] . "] - " . $track_name; + + return $track_name; + + } // get_user_playing + } //end localplay class ?> |