1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 01:39:28 +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"> <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy> <cross-domain-policy>
<allow-access-from domain="*" /> <allow-access-from domain="*" />
</cross-domain-policy> </cross-domain-policy>

View file

@ -194,7 +194,7 @@ class Recommendation
return false; return false;
} // get_artists_like } // get_artists_like
/** /**
* get_artist_info * get_artist_info
* Returns artist information * Returns artist information
@ -208,9 +208,9 @@ class Recommendation
$xml = self::get_lastfm_results('artist.getinfo', $query); $xml = self::get_lastfm_results('artist.getinfo', $query);
$results = array(); $results = array();
$results['summary'] = strip_tags(preg_replace("#<a href=([^<]*)Last\.fm</a>.#", "", (string)$xml->artist->bio->summary)); $results['summary'] = strip_tags(preg_replace("#<a href=([^<]*)Last\.fm</a>.#", "", (string) $xml->artist->bio->summary));
$results['placeformed'] = (string)$xml->artist->bio->placeformed; $results['placeformed'] = (string) $xml->artist->bio->placeformed;
$results['yearformed'] = (string)$xml->artist->bio->yearformed; $results['yearformed'] = (string) $xml->artist->bio->yearformed;
return $results; return $results;
} // get_artist_info } // 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 />'; $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); $version[] = array('version' => '360021', 'description' => $update_string);
$update_string = '- Remove unused live_stream fields and add codec field.<br />'; $update_string = '- Remove unused live_stream fields and add codec field.<br />';
$version[] = array('version' => '360022', 'description' => $update_string); $version[] = array('version' => '360022', 'description' => $update_string);
@ -1698,7 +1698,7 @@ class Update
return $retval; return $retval;
} }
/** /**
* update_360022 * 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`"; $sql = "ALTER TABLE `live_stream` ADD `codec` VARCHAR(32) NULL AFTER `catalog`, DROP `frequency`, DROP `call_sign`";
Dba::write($sql); Dba::write($sql);
$sql = "ALTER TABLE `stream_playlist` ADD `codec` VARCHAR(32) NULL AFTER `time`"; $sql = "ALTER TABLE `stream_playlist` ADD `codec` VARCHAR(32) NULL AFTER `time`";
Dba::write($sql); Dba::write($sql);
return true; return true;
} }
} }

View file

@ -139,8 +139,9 @@ class Catalog_soundcloud extends Catalog
require_once Config::get('prefix') . '/modules/php-soundcloud/Soundcloud.php'; 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"; 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)); Dba::write($sql, array($userid, $secret, $catalog_id));
return true; return true;
} }
protected function showAuthToken() protected function showAuthToken()
{ {
$api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri()); $api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri());
@ -191,7 +192,7 @@ class Catalog_soundcloud extends Catalog
echo "</form>"; echo "</form>";
echo "<br />"; echo "<br />";
} }
protected function completeAuthToken() protected function completeAuthToken()
{ {
$api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri()); $api = new Services_Soundcloud($this->userid, $this->secret, $this->getRedirectUri());
@ -216,7 +217,7 @@ class Catalog_soundcloud extends Catalog
if ($options != null) { if ($options != null) {
$this->authcode = $options['authcode']; $this->authcode = $options['authcode'];
} }
UI::show_box_top(T_('Running SoundCloud Remote Update') . '. . .'); UI::show_box_top(T_('Running SoundCloud Remote Update') . '. . .');
$this->update_remote_catalog(); $this->update_remote_catalog();
UI::show_box_bottom(); UI::show_box_bottom();
@ -233,7 +234,7 @@ class Catalog_soundcloud extends Catalog
$this->showAuthToken(); $this->showAuthToken();
return null; return null;
} }
$api = new Services_Soundcloud($this->userid, $this->secret); $api = new Services_Soundcloud($this->userid, $this->secret);
$api->setAccessToken($this->authtoken); $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"; echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush(); flush();
} }
} } catch (Exception $ex) {
catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n"; echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n";
} }
@ -320,7 +320,7 @@ class Catalog_soundcloud extends Catalog
public function clean_catalog_proc() public function clean_catalog_proc()
{ {
$dead = 0; $dead = 0;
try { try {
$api = $this->createClient(); $api = $this->createClient();
if ($api != null) { if ($api != null) {
@ -357,14 +357,13 @@ class Catalog_soundcloud extends Catalog
echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n"; echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush(); flush();
} }
} } catch (Exception $ex) {
catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n"; echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n";
} }
return $dead; return $dead;
} }
public function url_to_track($url) public function url_to_track($url)
{ {
$track = 0; $track = 0;
@ -418,7 +417,7 @@ class Catalog_soundcloud extends Catalog
if ($api != null) { if ($api != null) {
$track = $this->url_to_track($media->file); $track = $this->url_to_track($media->file);
debug_event('play', 'Starting stream - ' . $track, 5); debug_event('play', 'Starting stream - ' . $track, 5);
$headers = $api->stream($track); $headers = $api->stream($track);
if (isset($headers['Location'])) { if (isset($headers['Location'])) {
header('Location: ' . $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"; echo "<p>" . T_('API Error: cannot connect to SoundCloud.') . "</p><hr />\n";
flush(); flush();
} }
} } catch (Exception $ex) {
catch (Exception $ex) {
echo "<p>" . T_('SoundCloud exception: ') . $ex->getMessage() . "</p><hr />\n"; 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. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
*/ */
if (isset($_REQUEST['param_name'])) { if (isset($_REQUEST['param_name'])) {
$name = $_REQUEST['param_name']; $name = $_REQUEST['param_name'];
if (isset($_REQUEST[$name])) { if (isset($_REQUEST[$name])) {
echo $name . ": ". $_REQUEST[$name]; echo $name . ": ". $_REQUEST[$name];
} }
} }
if (isset($_REQUEST['error'])) { if (isset($_REQUEST['error'])) {
$error = $_REQUEST['error']; $error = $_REQUEST['error'];
$error_description = $_REQUEST['error_description']; $error_description = $_REQUEST['error_description'];