mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-02-22 05:09:02 +00:00
Empty commit
This commit is contained in:
parent
1d118971c9
commit
c166ade5a1
@ -66,13 +66,17 @@
|
|||||||
$DB->query("SELECT Name FROM artists_group WHERE ArtistID='$ArtistID'");
|
$DB->query("SELECT Name FROM artists_group WHERE ArtistID='$ArtistID'");
|
||||||
list($ArtistName) = $DB->next_record(MYSQLI_NUM,false);
|
list($ArtistName) = $DB->next_record(MYSQLI_NUM,false);
|
||||||
|
|
||||||
$DB->query("SELECT GroupID FROM torrents_artists WHERE ArtistID='$ArtistID'");
|
$DB->query("SELECT GroupID, Importance FROM torrents_artists WHERE ArtistID='$ArtistID'");
|
||||||
if($DB->record_count() == 0) { error(404); }
|
if($DB->record_count() == 0) { error(404); }
|
||||||
$GroupIDs = $DB->collect(0,false);
|
$Releases = $DB->to_array('GroupID',MYSQLI_ASSOC,false);
|
||||||
|
$GroupIDs = array_keys($Releases);
|
||||||
|
|
||||||
$SQL = "SELECT CASE ";
|
$SQL = "SELECT CASE ";
|
||||||
|
|
||||||
foreach ($_REQUEST['list'] as $Priority => $Selection) {
|
foreach ($_REQUEST['list'] as $Priority => $Selection) {
|
||||||
|
if(!is_number($Priority)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$SQL .= "WHEN ";
|
$SQL .= "WHEN ";
|
||||||
switch ($Selection) {
|
switch ($Selection) {
|
||||||
case '00': $SQL .= "t.Format='MP3' AND t.Encoding='V0 (VBR)'"; break;
|
case '00': $SQL .= "t.Format='MP3' AND t.Encoding='V0 (VBR)'"; break;
|
||||||
@ -103,7 +107,7 @@
|
|||||||
case '46': $SQL .= "t.Format='AAC' AND t.Encoding='192'"; break;
|
case '46': $SQL .= "t.Format='AAC' AND t.Encoding='192'"; break;
|
||||||
default: error(0);
|
default: error(0);
|
||||||
}
|
}
|
||||||
$SQL .= " THEN '".db_string($Priority)."' ";
|
$SQL .= " THEN $Priority ";
|
||||||
}
|
}
|
||||||
$SQL .= "ELSE 100 END AS Rank,
|
$SQL .= "ELSE 100 END AS Rank,
|
||||||
t.GroupID,
|
t.GroupID,
|
||||||
@ -121,10 +125,9 @@
|
|||||||
|
|
||||||
$DB->query($SQL);
|
$DB->query($SQL);
|
||||||
$Downloads = $DB->to_array('1',MYSQLI_NUM,false);
|
$Downloads = $DB->to_array('1',MYSQLI_NUM,false);
|
||||||
$Artists = get_artists($DB->collect('GroupID'), false);
|
$Artists = get_artists($GroupIDs, false);
|
||||||
$Skips = array();
|
$Skips = array();
|
||||||
$TotalSize = 0;
|
$TotalSize = 0;
|
||||||
|
|
||||||
if(count($Downloads)) {
|
if(count($Downloads)) {
|
||||||
foreach($Downloads as $Download) {
|
foreach($Downloads as $Download) {
|
||||||
$TorrentIDs[] = $Download[2];
|
$TorrentIDs[] = $Download[2];
|
||||||
@ -143,12 +146,19 @@
|
|||||||
$Skips[] = $Artist.$Album.' '.$Year;
|
$Skips[] = $Artist.$Album.' '.$Year;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if($Releases[$GroupID]['Importance'] == 1) {
|
||||||
|
$ReleaseTypeName = $ReleaseTypes[$ReleaseType];
|
||||||
|
} elseif($Releases[$GroupID]['Importance'] == 2) {
|
||||||
|
$ReleaseTypeName = "Guest Appearance";
|
||||||
|
} elseif($Releases[$GroupID]['Importance'] == 3) {
|
||||||
|
$ReleaseTypeName = "Remixed By";
|
||||||
|
}
|
||||||
$TotalSize += $Size;
|
$TotalSize += $Size;
|
||||||
$Contents = unserialize(base64_decode($Torrents[$TorrentID]['file']));
|
$Contents = unserialize(base64_decode($Torrents[$TorrentID]['file']));
|
||||||
$Tor = new TORRENT($Contents, true);
|
$Tor = new TORRENT($Contents, true);
|
||||||
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
|
$Tor->set_announce_url(ANNOUNCE_URL.'/'.$LoggedUser['torrent_pass'].'/announce');
|
||||||
unset($Tor->Val['announce-list']);
|
unset($Tor->Val['announce-list']);
|
||||||
$Zip->add_file($Tor->enc(), $ReleaseTypes[$ReleaseType].'/'.file_string($Artist.$Album).' - '.file_string($Year).' ('.file_string($Media).' - '.file_string($Format).' - '.file_string($Encoding).').torrent');
|
$Zip->add_file($Tor->enc(), $ReleaseTypeName.'/'.file_string($Artist.$Album).' - '.file_string($Year).' ('.file_string($Media).' - '.file_string($Format).' - '.file_string($Encoding).').torrent');
|
||||||
}
|
}
|
||||||
$Analyzed = count($Downloads);
|
$Analyzed = count($Downloads);
|
||||||
$Skipped = count($Skips);
|
$Skipped = count($Skips);
|
||||||
|
@ -69,6 +69,9 @@
|
|||||||
$SQL = "SELECT CASE ";
|
$SQL = "SELECT CASE ";
|
||||||
|
|
||||||
foreach ($_REQUEST['list'] as $Priority => $Selection) {
|
foreach ($_REQUEST['list'] as $Priority => $Selection) {
|
||||||
|
if(!is_number($Priority)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$SQL .= "WHEN ";
|
$SQL .= "WHEN ";
|
||||||
switch ($Selection) {
|
switch ($Selection) {
|
||||||
case '00': $SQL .= "t.Format='MP3' AND t.Encoding='V0 (VBR)'"; break;
|
case '00': $SQL .= "t.Format='MP3' AND t.Encoding='V0 (VBR)'"; break;
|
||||||
|
@ -112,7 +112,8 @@ function next_hour() {
|
|||||||
//------------- Front page stats ----------------------------------------//
|
//------------- Front page stats ----------------------------------------//
|
||||||
|
|
||||||
//Love or hate, this makes things a hell of a lot faster
|
//Love or hate, this makes things a hell of a lot faster
|
||||||
if ($Hour%6 == 0) {
|
|
||||||
|
if ($Hour%2 == 0) {
|
||||||
$DB->query("SELECT COUNT(uid) AS Snatches FROM xbt_snatched");
|
$DB->query("SELECT COUNT(uid) AS Snatches FROM xbt_snatched");
|
||||||
list($SnatchStats) = $DB->next_record();
|
list($SnatchStats) = $DB->next_record();
|
||||||
$Cache->cache_value('stats_snatches',$SnatchStats,0);
|
$Cache->cache_value('stats_snatches',$SnatchStats,0);
|
||||||
|
@ -292,14 +292,18 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
$OrderWay = 'desc';
|
$OrderWay = 'desc';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($_GET['order_by']) || !in_array($_GET['order_by'], array('year', 'time','size','seeders','leechers','snatched'))) {
|
if(empty($_GET['order_by']) || !in_array($_GET['order_by'], array('year','time','size','seeders','leechers','snatched','random'))) {
|
||||||
$_GET['order_by'] = 'time';
|
$_GET['order_by'] = 'time';
|
||||||
$OrderBy = 'time'; // For header links
|
$OrderBy = 'time'; // For header links
|
||||||
|
} elseif($_GET['order_by'] == 'random') {
|
||||||
|
$OrderBy = '@random';
|
||||||
|
$Way = SPH_SORT_EXTENDED;
|
||||||
|
$SS->limit(0, TORRENTS_PER_PAGE, TORRENTS_PER_PAGE);
|
||||||
} else {
|
} else {
|
||||||
$OrderBy = $_GET['order_by'];
|
$OrderBy = $_GET['order_by'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$SS->SetSortMode($Way, $_GET['order_by']);
|
$SS->SetSortMode($Way, $OrderBy);
|
||||||
|
|
||||||
|
|
||||||
if(count($Queries)>0) {
|
if(count($Queries)>0) {
|
||||||
@ -540,6 +544,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
|||||||
<option value="snatched"<?selected('order_by','snatched')?>>Snatched</option>
|
<option value="snatched"<?selected('order_by','snatched')?>>Snatched</option>
|
||||||
<option value="seeders"<?selected('order_by','seeders')?>>Seeders</option>
|
<option value="seeders"<?selected('order_by','seeders')?>>Seeders</option>
|
||||||
<option value="leechers"<?selected('order_by','leechers')?>>Leechers</option>
|
<option value="leechers"<?selected('order_by','leechers')?>>Leechers</option>
|
||||||
|
<option value="random"<?selected('order_by','random')?>>Random</option>
|
||||||
</select>
|
</select>
|
||||||
<select name="order_way">
|
<select name="order_way">
|
||||||
<option value="desc"<?selected('order_way','desc')?>>Descending</option>
|
<option value="desc"<?selected('order_way','desc')?>>Descending</option>
|
||||||
|
Loading…
Reference in New Issue
Block a user