summaryrefslogtreecommitdiffstats
path: root/lib/class/localplay.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/class/localplay.class.php')
-rw-r--r--lib/class/localplay.class.php25
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
?>