Empty commit

This commit is contained in:
Git 2013-09-10 08:00:47 +00:00
parent 40cd6e7202
commit 84710552c5
5 changed files with 9 additions and 32 deletions

View File

@ -104,25 +104,27 @@ public static function get_user_artist_chart($Username, $From = '', $To = '') {
}
public static function get_weekly_artists($Limit = 100) {
$Response = G::$Cache->get_value("lastfm_top_artists");
$Response = G::$Cache->get_value("lastfm_top_artists_$Limit");
if (empty($Response)) {
$Response = self::lastfm_request("chart.getTopArtists", array("limit" => $Limit));
$Response = json_encode($Response);
G::$Cache->cache_value("lastfm_top_artists", $Response, 86400);
G::$Cache->cache_value("lastfm_top_artists_$Limit", $Response, 86400);
}
return $Response;
}
public static function get_hyped_artists($Limit = 100) {
$Response = G::$Cache->get_value("lastfm_hyped_artists");
$Response = G::$Cache->get_value("lastfm_hyped_artists_$Limit");
if (empty($Response)) {
$Response = self::lastfm_request("chart.getHypedArtists", array("limit" => $Limit));
$Response = json_encode($Response);
G::$Cache->cache_value("lastfm_hyped_artists", $Response, 86400);
G::$Cache->cache_value("lastfm_hyped_artists_$Limit", $Response, 86400);
}
return $Response;
}
public static function clear_cache($Username, $Uid) {
$Response = G::$Cache->get_value('lastfm_clear_cache_' . G::$LoggedUser['ID'] . '_' . $_GET['id']);
if (empty($Response)) {

View File

@ -2,29 +2,4 @@
class Top10 {
public static function get_top_artists($Limit = '100') {
$Artists = G::$Cache->get_value("top_artists_$Limit");
if ($Artists === false) {
$QueryID = G::$DB->get_query_id();
G::$DB->query("
SELECT
a.ArtistID,
a.Name,
aw.Image
FROM torrents AS t
LEFT JOIN torrents_artists AS ta ON ta.GroupID = t.GroupID
LEFT JOIN artists_group AS a ON a.ArtistID = ta.ArtistID
LEFT JOIN wiki_artists AS aw ON aw.RevisionID = a.RevisionID
WHERE
(t.Snatched + t.Seeders) > (SELECT GREATEST(MAX(Snatched), MAX(Seeders)) / 2 FROM torrents)
GROUP BY a.ArtistID
ORDER BY (t.Snatched + t.Seeders) DESC
LIMIT $Limit");
$Artists = G::$DB->to_array();
G::$Cache->cache_value($Artists, "top_artists_$Limit", 86400);
G::$DB->set_query_id($QueryID);
}
return $Artists;
}
}

View File

@ -41,7 +41,7 @@ private static function get_selected_link($String, $Selected) {
public static function render_artist_tile($Artist, $Category) {
switch ($Category) {
case 'all_time':
self::render_tile("artist.php?id=", $Artist['id'], $Artist['Image']);
self::render_tile("artist.php?artistname", $Artist['Name'], $Artist['Image']);
break;
case 'weekly':
case 'hyped':

View File

@ -11,7 +11,7 @@ INSTALLATION NOTES
For documentation, read http://www.sphinxsearch.com/docs/current.html
After you've installed sphinx, create the indices:
/usr/local/bin/indexer -c /etc/sphinx/sphinx.conf --all
/usr/bin/indexer -c /etc/sphinx/sphinx.conf --all
4. Move classes/config.template to classes/config.php. Edit the config.php as needed.
We use http://grc.com/passwords.html for our passwords - you'll be generating a lot of these.

View File

@ -16,7 +16,7 @@
switch ($Category) {
case 'all_time':
$Artists = Top10::get_top_artists($Limit);
$Artists = LastFM::get_site_top_artists($Limit);
break;
case 'weekly':
$Artists = json_decode(LastFM::get_weekly_artists($Limit), true)['artists']['artist'];