Skip to content
Permalink
Browse files

Fix code style

  • Loading branch information
Afterster committed Nov 24, 2013
1 parent 9258027 commit 7af54ac88cfc6f89bd41bceaa493b8b592084083
Showing with 24 additions and 26 deletions.
  1. +1 −1 crossdomain.xml
  2. +4 −4 lib/class/recommendation.class.php
  3. +4 −4 lib/class/update.class.php
  4. +13 −15 modules/catalog/soundcloud.catalog.php
  5. +2 −2 show_get.php
@@ -2,4 +2,4 @@
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
</cross-domain-policy>
@@ -194,7 +194,7 @@ public static function get_artists_like($artist_id, $limit = 5, $local_only = tr

return false;
} // get_artists_like

/**
* get_artist_info
* Returns artist information
@@ -208,9 +208,9 @@ public static function get_artist_info($artist_id)
$xml = self::get_lastfm_results('artist.getinfo', $query);

$results = array();
$results['summary'] = strip_tags(preg_replace("#<a href=([^<]*)Last\.fm</a>.#", "", (string)$xml->artist->bio->summary));
$results['placeformed'] = (string)$xml->artist->bio->placeformed;
$results['yearformed'] = (string)$xml->artist->bio->yearformed;
$results['summary'] = strip_tags(preg_replace("#<a href=([^<]*)Last\.fm</a>.#", "", (string) $xml->artist->bio->summary));
$results['placeformed'] = (string) $xml->artist->bio->placeformed;
$results['yearformed'] = (string) $xml->artist->bio->yearformed;

return $results;
} // get_artist_info
@@ -310,7 +310,7 @@ public static function populate_version()

$update_string = '- Add insertion date on Now Playing and option to show the current song in page title for Web player.<br />';
$version[] = array('version' => '360021', 'description' => $update_string);

$update_string = '- Remove unused live_stream fields and add codec field.<br />';
$version[] = array('version' => '360022', 'description' => $update_string);

@@ -1698,7 +1698,7 @@ public static function update_360021()

return $retval;
}

/**
* update_360022
*
@@ -1708,10 +1708,10 @@ public static function update_360022()
{
$sql = "ALTER TABLE `live_stream` ADD `codec` VARCHAR(32) NULL AFTER `catalog`, DROP `frequency`, DROP `call_sign`";
Dba::write($sql);

$sql = "ALTER TABLE `stream_playlist` ADD `codec` VARCHAR(32) NULL AFTER `time`";
Dba::write($sql);

return true;
}
}
@@ -139,8 +139,9 @@ public function __construct($catalog_id = null)

require_once Config::get('prefix') . '/modules/php-soundcloud/Soundcloud.php';
}

protected function getRedirectUri() {

protected function getRedirectUri()
{
return Config::get('web_path') . "/show_get.php?param_name=code";
}

@@ -175,7 +176,7 @@ public static function create_type($catalog_id, $data)
Dba::write($sql, array($userid, $secret, $catalog_id));
return true;
}

protected function showAuthToken()
{
$api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri());
@@ -191,7 +192,7 @@ protected function showAuthToken()
echo "</form>";
echo "<br />";
}

protected function completeAuthToken()
{
$api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri());
@@ -216,7 +217,7 @@ public function add_to_catalog($options = null)
if ($options != null) {
$this->authcode = $options['authcode'];
}

UI::show_box_top(T_('Running SoundCloud Remote Update') . '. . .');
$this->update_remote_catalog();
UI::show_box_bottom();
@@ -233,7 +234,7 @@ public function createClient()
$this->showAuthToken();
return null;
}

$api = new Services_Soundcloud($this->userid, $this->secret);
$api->setAccessToken($this->authtoken);

@@ -298,8 +299,7 @@ public function update_remote_catalog()
echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush();
}
}
catch (Exception $ex) {
} catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n";
}

@@ -320,7 +320,7 @@ public function verify_catalog_proc()
public function clean_catalog_proc()
{
$dead = 0;

try {
$api = $this->createClient();
if ($api != null) {
@@ -357,14 +357,13 @@ public function clean_catalog_proc()
echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush();
}
}
catch (Exception $ex) {
} catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n";
}

return $dead;
}

public function url_to_track($url)
{
$track = 0;
@@ -418,7 +417,7 @@ public function prepare_media($media)
if ($api != null) {
$track = $this->url_to_track($media->file);
debug_event('play', 'Starting stream - ' . $track, 5);

$headers = $api->stream($track);
if (isset($headers['Location'])) {
header('Location: ' . $headers['Location']);
@@ -430,8 +429,7 @@ public function prepare_media($media)
echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush();
}
}
catch (Exception $ex) {
} catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n";
}

@@ -19,14 +19,14 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/

if (isset($_REQUEST['param_name'])) {
$name = $_REQUEST['param_name'];
if (isset($_REQUEST[$name])) {
echo $name . ": ". $_REQUEST[$name];
}
}

if (isset($_REQUEST['error'])) {
$error = $_REQUEST['error'];
$error_description = $_REQUEST['error_description'];

0 comments on commit 7af54ac

Please sign in to comment.
You can’t perform that action at this time.