diff options
Diffstat (limited to 'lib/class')
-rw-r--r-- | lib/class/random.class.php | 63 | ||||
-rw-r--r-- | lib/class/stream.class.php | 8 |
2 files changed, 66 insertions, 5 deletions
diff --git a/lib/class/random.class.php b/lib/class/random.class.php index 0863a60a..912aac95 100644 --- a/lib/class/random.class.php +++ b/lib/class/random.class.php @@ -28,13 +28,18 @@ */ class Random implements media { + public $type; + public $id; + + /** * Constructor * nothing to see here, move along */ - public function __construct() { + public function __construct($id) { - // Rien a faire + $this->type = Random::get_id_type($id); + $this->id = intval($id); } // constructor @@ -91,9 +96,9 @@ class Random implements media { * This generates a random play url based on the passed type * and returns it */ - public static function play_url($type,$sid='',$force_http='') { + public static function play_url($id,$sid='',$force_http='') { - if (!$type = self::validate_type($type)) { + if (!$type = self::get_id_type($id)) { return false; } @@ -420,6 +425,56 @@ class Random implements media { } // get_type_name /** + * get_type_id + * This takes random type and returns the ID + * MOTHER OF PEARL THIS MAKES BABY JESUS CRY + * HACK HACK HACK HACK HACK HACK HACK HACK + */ + public static function get_type_id($type) { + + switch ($type) { + case 'album': + return '1'; + break; + case 'artist': + return '2'; + break; + case 'tag': + return '3'; + break; + default: + return '4'; + break; + } + + } // get_type_id + + /** + * get_id_name + * This takes an ID and returns the 'name' of the random dealie + * HACK HACK HACK HACK HACK HACK HACK + * Can you tell I don't like this code? + */ + public static function get_id_type($id) { + + switch ($id) { + case '1': + return 'album'; + break; + case '2': + return 'artist'; + break; + case '3': + return 'tag'; + break; + default: + return 'default'; + break; + } // end switch + + } // get_id_name + + /** * validiate_type * this validates the random type */ diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index edffeb11..022e1e55 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -376,7 +376,13 @@ class Stream { echo "<ENTRY>\n"; echo "<TITLE>$name</TITLE>\n"; - echo "<AUTHOR>$author</AUTHOR>\n"; + echo "<AUTHOR>$author</AUTHOR>\n"; + echo "\t\t<COPYRIGHT>".$media->year."</COPYRIGHT>\n"; + echo "\t\t<DURATION VALUE=\"00:00:".$media->time."\" />\n"; + echo "\t\t<PARAM NAME=\"Album\" Value=\"".$media->f_album_full."\" />\n"; + echo "\t\t<PARAM NAME=\"Genre\" Value=\"".$media->get_genre_name()."\" />\n"; + echo "\t\t<PARAM NAME=\"Composer\" Value=\"".$media->f_artist_full."\" />\n"; + echo "\t\t<PARAM NAME=\"Prebuffer\" Value=\"false\" />\n"; echo "<REF HREF = \"". $url . "\" />\n"; echo "</ENTRY>\n"; |