Skip to content

Commit a197cad

Browse files
committed
fix torrentrss descr
1 parent a74a2c3 commit a197cad

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

nexus/Torrent/Torrent.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ public function renderTorrentsPageAverageRating(array $torrentInfo): string
7474
if (is_null($ptGen)) {
7575
$ptGen = new PTGen();
7676
}
77-
$ptGenInfo = $torrentInfo['pt_gen'];
78-
if (!is_array($torrentInfo['pt_gen']) && is_string($torrentInfo['pt_gen'])) {
79-
$ptGenInfo = json_decode($ptGenInfo, true);
80-
}
77+
// $ptGenInfo = $torrentInfo['pt_gen'];
78+
// if (!is_array($torrentInfo['pt_gen']) && is_string($torrentInfo['pt_gen'])) {
79+
// $ptGenInfo = json_decode($ptGenInfo, true);
80+
// }
8181

8282
$log = "torrent: " . $torrentInfo['id'];
83-
$siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']);
83+
// $siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']);
84+
$siteIdAndRating = $ptGen->listRatings([], $torrentInfo['url']);
8485
$log .= "siteIdAndRating: " . json_encode($siteIdAndRating);
8586
do_log($log);
8687
return $ptGen->buildRatingSpan($siteIdAndRating);

public/torrentrss.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,14 @@ function get_where($tablename = "sources", $itemname = "source", $getname = "sou
171171
}
172172
}
173173
$sort = "id desc";
174-
$fieldStr = "torrents.id, torrents.category, torrents.name, torrents.small_descr, torrents.descr, torrents.info_hash, torrents.size, torrents.added, torrents.anonymous, torrents.owner, categories.name AS category_name";
175-
//$query = "SELECT torrents.id, torrents.category, torrents.name, torrents.small_descr, torrents.descr, torrents.info_hash, torrents.size, torrents.added, torrents.anonymous, users.username AS username, categories.id AS cat_id, categories.name AS cat_name FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where ORDER BY $sort LIMIT $limit";
174+
$fieldStr = "torrents.id, torrents.category, torrents.name, torrents.small_descr, torrent_extras.descr, torrents.info_hash, torrents.size, torrents.added, torrents.anonymous, torrents.owner, categories.name AS category_name";
176175
if (!$noNormalResults) {
177-
$query = "SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id $normalWhere ORDER BY $sort LIMIT $limit";
176+
$query = "SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id left join torrent_extras on torrent_extras.torrent_id = torrents.id $normalWhere ORDER BY $sort LIMIT $limit";
178177
$normalRows = \Nexus\Database\NexusDB::select($query);
179178
}
180179
if (!empty($prependIdArr) && $startindex == 0) {
181180
$prependIdStr = implode(',', $prependIdArr);
182-
$prependRows = \Nexus\Database\NexusDB::select("SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id where torrents.id in ($prependIdStr) and $where ORDER BY field(torrents.id, $prependIdStr)");
181+
$prependRows = \Nexus\Database\NexusDB::select("SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id left join torrent_extras on torrent_extras.torrent_id = torrents.id where torrents.id in ($prependIdStr) and $where ORDER BY field(torrents.id, $prependIdStr)");
183182
}
184183
$list = [];
185184
foreach ($prependRows as $row) {

0 commit comments

Comments
 (0)