/** * getSongsByGenre * Get songs in a given genre. * Takes the genre with optional count and offset in parameters. */ public static function getsongsbygenre($input) { self::check_version($input, "1.9.0"); $genre = self::check_parameter($input, 'genre'); $count = $input['count']; $offset = $input['offset']; $tag = Tag::construct_from_name($genre); if ($tag->id) { $songs = Tag::get_tag_objects("song", $tag->id, $count, $offset); } else { $songs = array(); } $r = Subsonic_XML_Data::createSuccessResponse(); Subsonic_XML_Data::addSongsByGenre($r, $songs); self::apiOutput($input, $r); }