1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +02:00

Fix code style

This commit is contained in:
Afterster 2013-11-24 02:44:22 +01:00
parent 92580278bd
commit 7af54ac88c
5 changed files with 24 additions and 26 deletions

View file

@ -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>

View file

@ -194,7 +194,7 @@ class Recommendation
return false;
} // get_artists_like
/**
* get_artist_info
* Returns artist information
@ -208,9 +208,9 @@ class Recommendation
$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

View file

@ -310,7 +310,7 @@ class Update
$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 @@ class Update
return $retval;
}
/**
* update_360022
*
@ -1708,10 +1708,10 @@ class Update
{
$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;
}
}

View file

@ -139,8 +139,9 @@ class Catalog_soundcloud extends Catalog
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 @@ class Catalog_soundcloud extends Catalog
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 @@ class Catalog_soundcloud extends Catalog
echo "</form>";
echo "<br />";
}
protected function completeAuthToken()
{
$api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri());
@ -216,7 +217,7 @@ class Catalog_soundcloud extends Catalog
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 @@ class Catalog_soundcloud extends Catalog
$this->showAuthToken();
return null;
}
$api = new Services_Soundcloud($this->userid, $this->secret);
$api->setAccessToken($this->authtoken);
@ -298,8 +299,7 @@ class Catalog_soundcloud extends 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 @@ class Catalog_soundcloud extends Catalog
public function clean_catalog_proc()
{
$dead = 0;
try {
$api = $this->createClient();
if ($api != null) {
@ -357,14 +357,13 @@ class Catalog_soundcloud extends 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";
}
return $dead;
}
public function url_to_track($url)
{
$track = 0;
@ -418,7 +417,7 @@ class Catalog_soundcloud extends Catalog
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 @@ class Catalog_soundcloud extends 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";
}

View file

@ -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'];