diff --git a/classes/class_cache.php b/classes/class_cache.php index 8521dd3c..d6f6fd2a 100644 --- a/classes/class_cache.php +++ b/classes/class_cache.php @@ -303,6 +303,7 @@ public function update($Key, $Rows, $Values, $Time=2592000) { } // Built-in increment/decrement functions are said not to be thread safe +/* Supposedly fixed in v1.4.6 public function increment($Key, $Value=1) { if(($OldValue = $this->get($Key)) === false || !is_number($Value)) { return false; @@ -319,5 +320,5 @@ public function decrement($Key, $Value=1) { } $this->replace_value($Key, $OldValue-$Value); } - +*/ } diff --git a/classes/script_start.php b/classes/script_start.php index ffa53a2a..333f29fb 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -1618,9 +1618,9 @@ function get_groups($GroupIDs, $Return = true, $GetArtists = true) { foreach($GroupIDs as $GroupID) { $Data = $Cache->get_value('torrent_group_'.$GroupID, true); - if(!empty($Data)) { + if(!empty($Data) && (@$Data['ver'] >= 2)) { unset($NotFound[$GroupID]); - $Found[$GroupID] = $Data; + $Found[$GroupID] = $Data['d']; } } @@ -1645,11 +1645,11 @@ function get_groups($GroupIDs, $Return = true, $GetArtists = true) { $DB->query("SELECT ID, GroupID, Media, Format, Encoding, RemasterYear, Remastered, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Scene, HasLog, HasCue, LogScore, FileCount, FreeTorrent, Size, Leechers, Seeders, Snatched, Time, ID AS HasFile - FROM torrents AS t WHERE GroupID IN($IDs) ORDER BY GroupID, RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Format, Encoding"); + FROM torrents AS t WHERE GroupID IN($IDs) ORDER BY GroupID, RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Media, Format, Encoding"); while($Torrent = $DB->next_record(MYSQLI_ASSOC, true)) { $Found[$Torrent['GroupID']]['Torrents'][$Torrent['ID']] = $Torrent; - $Cache->cache_value('torrent_group_'.$Torrent['GroupID'], $Found[$Torrent['GroupID']], 0); + $Cache->cache_value('torrent_group_'.$Torrent['GroupID'], array('ver'=>2, 'd'=>$Found[$Torrent['GroupID']]), 0); } } @@ -1802,7 +1802,6 @@ function torrent_info($Data) { $Info[]=$Str; } if(!empty($Data['HasCue'])) { $Info[]='Cue'; } - if(!empty($Data['Media'])) { $Info[]=$Data['Media']; } if(!empty($Data['Scene'])) { $Info[]='Scene'; } if($Data['FreeTorrent'] == '1') { $Info[]='Freeleech!'; } if($Data['FreeTorrent'] == '2') { $Info[]='Neutral Leech!'; } diff --git a/sections/artist/artist.php b/sections/artist/artist.php index ec3dce64..8b19e2a6 100644 --- a/sections/artist/artist.php +++ b/sections/artist/artist.php @@ -176,6 +176,7 @@ function compare($X, $Y){ $NumSnatches = 0; $OpenTable = false; +$ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] == 1); foreach ($TorrentList as $GroupID=>$Group) { list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel, $GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse, $Torrents, $Artists) = array_values($Group); $GroupVanityHouse = $Importances[$GroupID]['VanityHouse']; @@ -224,6 +225,7 @@ function compare($X, $Y){ + @@ -250,6 +252,11 @@ function compare($X, $Y){ ?> + - + + - - + + - - + - + + - - + + - + - + + - - + + - + - - + + - - + + - + - + + - - + + - + - +
  (View) Size Snatches
+
+ +
+
@@ -260,6 +267,9 @@ function compare($X, $Y){ $LastRemasterTitle = ''; $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; + $LastMedia = ''; + + $EditionID = 0; foreach ($Torrents as $TorrentID => $Torrent) { $NumTorrents++; @@ -273,7 +283,10 @@ function compare($X, $Y){ $NumSnatches+=$Torrent['Snatched']; if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { + + $EditionID++; + if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { $RemasterName = $Torrent['RemasterYear']; @@ -281,10 +294,11 @@ function compare($X, $Y){ if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; } if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; } + $RemasterName .= $AddExtra.display_str($Torrent['Media']); ?> -
+
[] @@ -328,7 +344,7 @@ function compare($X, $Y){ //----------------- End building list and getting stats -show_header($Name, 'requests,bbcode'); +show_header($Name, 'browse,requests,bbcode'); ?>

(Revision #) [Vanity House]

diff --git a/sections/bookmarks/torrents.php b/sections/bookmarks/torrents.php index 0c5e19fd..f72cee98 100644 --- a/sections/bookmarks/torrents.php +++ b/sections/bookmarks/torrents.php @@ -109,7 +109,7 @@ function compare($X, $Y){
- +
@@ -132,11 +132,16 @@ function compare($X, $Y){ $LastRemasterTitle = ''; $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; + $LastMedia = ''; + + $EditionID = 0; foreach ($Torrents as $TorrentID => $Torrent) { if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { + + $EditionID++; if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { $RemasterName = $Torrent['RemasterYear']; @@ -144,10 +149,11 @@ function compare($X, $Y){ if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; } if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; } + $RemasterName .= $AddExtra.display_str($Torrent['Media']); ?> -
[DL] diff --git a/sections/collages/collage.php b/sections/collages/collage.php index 880d29f1..289d04b4 100644 --- a/sections/collages/collage.php +++ b/sections/collages/collage.php @@ -136,7 +136,7 @@ function compare($X, $Y){
- +
@@ -152,22 +152,28 @@ function compare($X, $Y){ $LastRemasterTitle = ''; $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; + $LastMedia = ''; + + $EditionID = 0; foreach ($Torrents as $TorrentID => $Torrent) { if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear || - $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) { + $Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $Torrent['Media'] != $LastMedia) { if($Torrent['RemasterTitle'] || $Torrent['RemasterYear'] || $Torrent['RemasterRecordLabel'] || $Torrent['RemasterCatalogueNumber']) { + + $EditionID++; $RemasterName = $Torrent['RemasterYear']; $AddExtra = " - "; if($Torrent['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterRecordLabel']); $AddExtra=' / '; } if($Torrent['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Torrent['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Torrent['RemasterTitle']); $AddExtra=' / '; } + $RemasterName .= $AddExtra.display_str($Torrent['Media']); ?> -
[DL] diff --git a/sections/peerupdate/index.php b/sections/peerupdate/index.php index 586ac324..7c829d0a 100644 --- a/sections/peerupdate/index.php +++ b/sections/peerupdate/index.php @@ -30,7 +30,8 @@ while(list($GroupID,$Seeders,$Leechers,$Snatched) = $DB->next_record(MYSQLI_NUM)) { $Data = $Cache->get_value('torrent_group_'.$GroupID); - if(!is_array($Data)) { continue; } + if (!(is_array($Data) && (@$Data['ver'] >= 2))) { continue; } + $Data = $Data['d']; $Changed = false; @@ -89,4 +90,4 @@ echo '
';
 	show_footer();
 }
-?>
\ No newline at end of file
+?>
diff --git a/sections/torrents/browse2.php b/sections/torrents/browse2.php
index 13a7c086..4bb243ad 100644
--- a/sections/torrents/browse2.php
+++ b/sections/torrents/browse2.php
@@ -696,12 +696,12 @@ function header_link($SortKey,$DefaultWay="desc") {
 		if($GroupVanityHouse) { $DisplayName .= ' [VH]'; }
 ?>
 	
+
- +
@@ -731,6 +731,9 @@ function header_link($SortKey,$DefaultWay="desc") { $LastRemasterTitle = ''; $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; + $LastMedia = ''; + + $EditionID = 0; foreach($Torrents as $TorrentID => $Data) { // All of the individual torrents in the group @@ -826,18 +829,20 @@ function header_link($SortKey,$DefaultWay="desc") { } if($CategoryID == 1 && ($Data['RemasterTitle'] != $LastRemasterTitle || $Data['RemasterYear'] != $LastRemasterYear || - $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Data['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber)) { + $Data['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Data['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber) || $Data['Media'] != $LastMedia) { if($Data['RemasterTitle'] || $Data['RemasterYear'] || $Data['RemasterRecordLabel'] || $Data['RemasterCatalogueNumber']) { + $EditionID++; $RemasterName = $Data['RemasterYear']; $AddExtra = " - "; if($Data['RemasterRecordLabel']) { $RemasterName .= $AddExtra.display_str($Data['RemasterRecordLabel']); $AddExtra=' / '; } if($Data['RemasterCatalogueNumber']) { $RemasterName .= $AddExtra.display_str($Data['RemasterCatalogueNumber']); $AddExtra=' / '; } if($Data['RemasterTitle']) { $RemasterName .= $AddExtra.display_str($Data['RemasterTitle']); $AddExtra=' / '; } + $RemasterName .= $AddExtra.display_str($Data['Media']); ?> -
[ diff --git a/sections/torrents/details.php b/sections/torrents/details.php index 913a72a5..7882c576 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -279,6 +279,8 @@ function filelist($Str) { $LastRemasterRecordLabel = ''; $LastRemasterCatalogueNumber = ''; +$EditionID = 0; + foreach ($TorrentList as $Torrent) { //t.ID, t.Media, t.Format, t.Encoding, t.Remastered, t.RemasterYear, t.RemasterTitle, t.RemasterRecordLabel,t.RemasterCatalogueNumber, @@ -352,12 +354,12 @@ function filelist($Str) { $TorrentUploader = $Username; // Save this for "Uploaded by:" below + // similar to torrent_info() if($Format) { $ExtraInfo.=display_str($Format); $AddExtra=' / '; } if($Encoding) { $ExtraInfo.=$AddExtra.display_str($Encoding); $AddExtra=' / '; } if($HasLog) { $ExtraInfo.=$AddExtra.'Log'; $AddExtra=' / '; } if($HasLog && $LogInDB) { $ExtraInfo.=' ('.(int) $LogScore.'%)'; } if($HasCue) { $ExtraInfo.=$AddExtra.'Cue'; $AddExtra=' / '; } - if($Media) { $ExtraInfo.=$AddExtra.display_str($Media); $AddExtra=' / '; } if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; } if(!$ExtraInfo) { $ExtraInfo = $GroupName ; $AddExtra=' / '; @@ -376,7 +378,10 @@ function filelist($Str) { || $RemasterYear != $LastRemasterYear || $RemasterRecordLabel != $LastRemasterRecordLabel || $RemasterCatalogueNumber != $LastRemasterCatalogueNumber - || $FirstUnknown)) { + || $FirstUnknown + || $Media != $LastMedia)) { + + $EditionID++; if($Remastered && $RemasterYear != 0){ @@ -385,9 +390,10 @@ function filelist($Str) { if($RemasterRecordLabel) { $RemasterName .= $AddExtra.display_str($RemasterRecordLabel); $AddExtra=' / '; } if($RemasterCatalogueNumber) { $RemasterName .= $AddExtra.display_str($RemasterCatalogueNumber); $AddExtra=' / '; } if($RemasterTitle) { $RemasterName .= $AddExtra.display_str($RemasterTitle); $AddExtra=' / '; } + $RemasterName .= $AddExtra.display_str($Media); ?> -
[ @@ -437,7 +445,7 @@ function filelist($Str) {
Uploaded by diff --git a/sections/torrents/functions.php b/sections/torrents/functions.php index 7c701f60..058d73d1 100644 --- a/sections/torrents/functions.php +++ b/sections/torrents/functions.php @@ -102,7 +102,7 @@ function get_group_info($GroupID, $Return = true, $RevisionID = 0) { WHERE t.GroupID='".db_string($GroupID)."' AND flags != 1 GROUP BY t.ID - ORDER BY t.Remastered ASC, (t.RemasterYear <> 0) DESC, t.RemasterYear ASC, t.RemasterTitle ASC, t.RemasterRecordLabel ASC, t.RemasterCatalogueNumber ASC, t.Format, t.Encoding, t.ID"); + ORDER BY t.Remastered ASC, (t.RemasterYear <> 0) DESC, t.RemasterYear ASC, t.RemasterTitle ASC, t.RemasterRecordLabel ASC, t.RemasterCatalogueNumber ASC, t.Media ASC, t.Format, t.Encoding, t.ID"); $TorrentList = $DB->to_array(); if(count($TorrentList) == 0) { diff --git a/static/functions/browse.js b/static/functions/browse.js index d1e885a5..0dee27a8 100644 --- a/static/functions/browse.js +++ b/static/functions/browse.js @@ -91,17 +91,18 @@ function toggle_group(groupid, link, event) { clickedRow = clickedRow.parentNode; } var group_rows = clickedRow.parentNode.children; - //var showing = has_class(nextElementSibling(clickedRow), 'hidden'); // nextElementSibling(clickedRow) is a .edition var showing = $(clickedRow).nextElementSibling().has_class('hidden'); var allGroups = event.ctrlKey; for (var i = 0; i < group_rows.length; i++) { var row = $(group_rows[i]); if (row.has_class('colhead_dark')) { continue; } if (row.has_class('colhead')) { continue; } - var relevantRow = row.has_class('group') ? row.nextElementSibling() : row; + var relevantRow = row.has_class('group') ? $(group_rows[i+1]) : row; if (allGroups || relevantRow.has_class('groupid_' + groupid)) { + row = $(group_rows[i]); // idk why we need this :S if (row.has_class('group')) { - $('a.show_torrents_link', row).raw().title = (showing) ? 'Collapse this group' : 'Expand this group'; + $('a.show_torrents_link', row.raw()).raw().title = (showing) ? 'Collapse this group' : 'Expand this group'; + $('a.show_torrents_link', row.raw()).raw().parentNode.className = (showing) ? 'hide_torrents' : 'show_torrents'; } else { if (showing) { // show the row depending on whether the edition it's in is collapsed or not @@ -135,7 +136,7 @@ function toggle_edition(groupid, editionid, lnk, event) { var group_rows = $('tr.groupid_' + groupid); for (var i = 0; i < group_rows.results(); i++) { var row = $(group_rows.raw(i)); - if (row.has_class('edition') && (allEditions || row == clickedRow)) { + if (row.has_class('edition') && (allEditions || row.raw(0) == clickedRow)) { $('a', row.raw()).raw().innerHTML = (showing) ? '−' : '+'; $('a', row.raw()).raw().title = (showing) ? 'Collapse this edition' : 'Expand this edition'; continue; @@ -185,15 +186,3 @@ function ToggleEditionRows() { $('#edition_label').toggle(); $('#edition_catalogue').toggle(); } - - -function ToggleGroup(groupid) { - var show = $('#showimg_' + groupid).has_class('show_torrents') - if(show) { - $('.groupid_' + groupid).show(); - $('#showimg_' + groupid).remove_class('show_torrents').add_class('hide_torrents'); - } else { - $('.groupid_' + groupid).hide(); - $('#showimg_' + groupid).remove_class('hide_torrents').add_class('show_torrents'); - } -} diff --git a/static/functions/script_start.js b/static/functions/script_start.js index fbc8133c..9481e328 100644 --- a/static/functions/script_start.js +++ b/static/functions/script_start.js @@ -259,7 +259,7 @@ util.fn = util.prototype = { return this.objects[number]; }, nextElementSibling: function () { - here = this.objects[0]; + var here = this.objects[0]; if (here.nextElementSibling) { return $(here.nextElementSibling); } @@ -269,7 +269,7 @@ util.fn = util.prototype = { return $(here); }, previousElementSibling: function () { - here = this.objects[0]; + var here = this.objects[0]; if (here.previousElementSibling) { return $(here.previousElementSibling); }