mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-21 12:49:03 +00:00
Empty commit
This commit is contained in:
parent
40cd6e7202
commit
84710552c5
@ -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)) {
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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':
|
||||
|
@ -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.
|
||||
|
@ -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'];
|
||||
|
Loading…
Reference in New Issue
Block a user