Empty commit

This commit is contained in:
Git 2014-05-07 08:00:45 +00:00
parent 779df50017
commit 985a8769a4
13 changed files with 86 additions and 50 deletions

View File

@ -45,7 +45,7 @@ public static function update_sphinx_requests($RequestID) {
WHERE ID = $RequestID");
G::$DB->set_query_id($QueryID);
G::$Cache->delete_value("requests_$RequestID");
G::$Cache->delete_value("request_$RequestID");
}

View File

@ -173,7 +173,11 @@ function compare($X, $Y) {
$JsonTorrents = array();
$Tags = array();
$NumTorrents = $NumSeeders = $NumLeechers = $NumSnatches = 0;
foreach ($TorrentList as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
foreach ($Artists as &$Artist) {

View File

@ -19,7 +19,11 @@
$Results = Torrents::get_groups(array_keys($GroupIDs));
$JsonResults = array();
foreach ($Results as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($Results[$GroupID])) {
continue;
}
$Group = $Results[$GroupIDs];
extract(Torrents::array_group($Group));
$FlacID = $GroupIDs[$GroupID]['TorrentID'];

View File

@ -29,45 +29,49 @@ function compare($X, $Y) {
$JsonBookmarks = array();
list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
foreach ($TorrentList as $Torrent) {
list($GroupIDs, $CollageDataList, $GroupList) = Users::get_bookmarks($UserID);
foreach($GroupIDs as $GroupID) {
if (!isset($GroupList[$GroupID])) {
continue;
}
$Group = $GroupList[$GroupID];
$JsonTorrents = array();
foreach ($Torrent['Torrents'] as $GroupTorrents) {
foreach ($Group['Torrents'] as $Torrent) {
$JsonTorrents[] = array(
'id' => (int)$GroupTorrents['ID'],
'groupId' => (int)$GroupTorrents['GroupID'],
'media' => $GroupTorrents['Media'],
'format' => $GroupTorrents['Format'],
'encoding' => $GroupTorrents['Encoding'],
'remasterYear' => (int)$GroupTorrents['RemasterYear'],
'remastered' => $GroupTorrents['Remastered'] == 1,
'remasterTitle' => $GroupTorrents['RemasterTitle'],
'remasterRecordLabel' => $GroupTorrents['RemasterRecordLabel'],
'remasterCatalogueNumber' => $GroupTorrents['RemasterCatalogueNumber'],
'scene' => $GroupTorrents['Scene'] == 1,
'hasLog' => $GroupTorrents['HasLog'] == 1,
'hasCue' => $GroupTorrents['HasCue'] == 1,
'logScore' => (float)$GroupTorrents['LogScore'],
'fileCount' => (int)$GroupTorrents['FileCount'],
'freeTorrent' => $GroupTorrents['FreeTorrent'] == 1,
'size' => (float)$GroupTorrents['Size'],
'leechers' => (int)$GroupTorrents['Leechers'],
'seeders' => (int)$GroupTorrents['Seeders'],
'snatched' => (int)$GroupTorrents['Snatched'],
'time' => $GroupTorrents['Time'],
'hasFile' => (int)$GroupTorrents['HasFile']
'id' => (int)$Torrent['ID'],
'groupId' => (int)$Torrent['GroupID'],
'media' => $Torrent['Media'],
'format' => $Torrent['Format'],
'encoding' => $Torrent['Encoding'],
'remasterYear' => (int)$Torrent['RemasterYear'],
'remastered' => $Torrent['Remastered'] == 1,
'remasterTitle' => $Torrent['RemasterTitle'],
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
'remasterCatalogueNumber' => $Torrent['RemasterCatalogueNumber'],
'scene' => $Torrent['Scene'] == 1,
'hasLog' => $Torrent['HasLog'] == 1,
'hasCue' => $Torrent['HasCue'] == 1,
'logScore' => (float)$Torrent['LogScore'],
'fileCount' => (int)$Torrent['FileCount'],
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
'size' => (float)$Torrent['Size'],
'leechers' => (int)$Torrent['Leechers'],
'seeders' => (int)$Torrent['Seeders'],
'snatched' => (int)$Torrent['Snatched'],
'time' => $Torrent['Time'],
'hasFile' => (int)$Torrent['HasFile']
);
}
$JsonBookmarks[] = array(
'id' => (int)$Torrent['ID'],
'name' => $Torrent['Name'],
'year' => (int)$Torrent['Year'],
'recordLabel' => $Torrent['RecordLabel'],
'catalogueNumber' => $Torrent['CatalogueNumber'],
'tagList' => $Torrent['TagList'],
'releaseType' => $Torrent['ReleaseType'],
'vanityHouse' => $Torrent['VanityHouse'] == 1,
'image' => $CollageDataList[$Torrent['ID']]['WikiImage'],
'id' => (int)$Group['ID'],
'name' => $Group['Name'],
'year' => (int)$Group['Year'],
'recordLabel' => $Group['RecordLabel'],
'catalogueNumber' => $Group['CatalogueNumber'],
'tagList' => $Group['TagList'],
'releaseType' => $Group['ReleaseType'],
'vanityHouse' => $Group['VanityHouse'] == 1,
'image' => $Group['WikiImage'],
'torrents' => $JsonTorrents
);
}

View File

@ -29,7 +29,11 @@
<td>Torrent</td>
</tr>
<?
foreach ($Results as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($Results[$GroupID])) {
continue;
}
$Group = $Results[$GroupID];
extract(Torrents::array_group($Group));
$TorrentTags = new Tags($TagList);

View File

@ -26,7 +26,7 @@
$EditType = isset($_GET['type']) ? $_GET['type'] : 'torrents';
list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID); // TODO: $TorrentList might not have the correct order, use the $GroupIDs instead
$TT = new MASS_USER_TORRENTS_TABLE_VIEW($TorrentList, $CollageDataList, $EditType, 'Organize Torrent Bookmarks');
$TT->render_all();

View File

@ -36,8 +36,12 @@ function compare($X, $Y) {
$NumGroups = 0;
$ArtistCount = array();
list(, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
foreach ($TorrentList as $GroupID => $Group) {
list($GroupIDs, $CollageDataList, $TorrentList) = Users::get_bookmarks($UserID);
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
list(, $Sort, $AddedTime) = array_values($CollageDataList[$GroupID]);

View File

@ -80,7 +80,11 @@
<?
$Number = 0;
foreach ($TorrentList as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
list(, $UserID, $Username, $Sort, $CatNum) = array_values($CollageDataList[$GroupID]);

View File

@ -34,7 +34,11 @@ function compare($X, $Y) {
$UserAdditions = array();
$Number = 0;
foreach ($TorrentList as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
$UserID = $Contributors[$GroupID];
$TorrentTags = new Tags($TagList);

View File

@ -91,7 +91,7 @@
ORDER BY Time DESC
LIMIT 20");
$Blog = $DB->to_array();
$Cache->cache_value('Blog', $Blog, 1209600);
$Cache->cache_value('blog', $Blog, 1209600);
}
foreach ($Blog as $BlogItem) {
list($BlogID, $Author, $AuthorID, $Title, $Body, $BlogTime, $ThreadID) = $BlogItem;

View File

@ -46,7 +46,11 @@
$Groups = Torrents::get_groups($Top10Groups, true, true, false);
$i = 0;
foreach ($Groups as $MatchGroupID => $MatchGroup) {
foreach ($Top10Groups as $MatchGroupID) {
if (!isset($Groups[$MatchGroupID])) {
continue;
}
$MatchGroup = $Groups[$MatchGroupID];
$i++;
$Str = Artists::display_artists($MatchGroup['ExtendedArtists']).'<a href="torrents.php?id='.$MatchGroupID.'">'.$MatchGroup['Name'].'</a>';
?>

View File

@ -424,14 +424,14 @@
|| (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
$UpdateSet[] = "Uploaded = '$Uploaded'";
$EditSummary[] = "uploaded changed from ".Format::get_size($Cur['Uploaded']).' to '.Format::get_size($Uploaded);
$Cache->delete_value("users_stats_$UserID");
$Cache->delete_value("user_stats_$UserID");
}
if ($Downloaded != $Cur['Downloaded'] && $Downloaded != $_POST['OldDownloaded'] && (check_perms('users_edit_ratio')
|| (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
$UpdateSet[] = "Downloaded = '$Downloaded'";
$EditSummary[] = "downloaded changed from ".Format::get_size($Cur['Downloaded']).' to '.Format::get_size($Downloaded);
$Cache->delete_value("users_stats_$UserID");
$Cache->delete_value("user_stats_$UserID");
}
if ($FLTokens != $Cur['FLTokens'] && (check_perms('users_edit_ratio') || (check_perms('users_edit_own_ratio') && $UserID == $LoggedUser['ID']))) {
@ -714,8 +714,8 @@
$UpdateSet[] = "Uploaded = Uploaded + '$MergeUploaded'";
$UpdateSet[] = "Downloaded = Downloaded + '$MergeDownloaded'";
$EditSummary[] = 'stats merged from '.site_url()."user.php?id=$MergeID ($MergeStatsFrom) (previous stats: Uploaded: ".Format::get_size($Cur['Uploaded']).', Downloaded: '.Format::get_size($Cur['Downloaded']).', Ratio: '.Format::get_ratio($Cur['Uploaded'], $Cur['Downloaded']).')';
$Cache->delete_value("users_stats_$UserID");
$Cache->delete_value("users_stats_$MergeID");
$Cache->delete_value("user_stats_$UserID");
$Cache->delete_value("user_stats_$MergeID");
}
}

View File

@ -97,7 +97,11 @@
$Artists = Artists::get_artists($GroupIDs);
$Number = 0;
foreach ($TorrentList as $GroupID => $Group) {
foreach ($GroupIDs as $GroupID) {
if (!isset($TorrentList[$GroupID])) {
continue;
}
$Group = $TorrentList[$GroupID];
extract(Torrents::array_group($Group));
$DisplayName = '';