diff --git a/nexus/Torrent/Torrent.php b/nexus/Torrent/Torrent.php index 6daf08d2..e36026cc 100644 --- a/nexus/Torrent/Torrent.php +++ b/nexus/Torrent/Torrent.php @@ -74,13 +74,14 @@ class Torrent if (is_null($ptGen)) { $ptGen = new PTGen(); } - $ptGenInfo = $torrentInfo['pt_gen']; - if (!is_array($torrentInfo['pt_gen']) && is_string($torrentInfo['pt_gen'])) { - $ptGenInfo = json_decode($ptGenInfo, true); - } +// $ptGenInfo = $torrentInfo['pt_gen']; +// if (!is_array($torrentInfo['pt_gen']) && is_string($torrentInfo['pt_gen'])) { +// $ptGenInfo = json_decode($ptGenInfo, true); +// } $log = "torrent: " . $torrentInfo['id']; - $siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']); +// $siteIdAndRating = $ptGen->listRatings($ptGenInfo ?? [], $torrentInfo['url']); + $siteIdAndRating = $ptGen->listRatings([], $torrentInfo['url']); $log .= "siteIdAndRating: " . json_encode($siteIdAndRating); do_log($log); return $ptGen->buildRatingSpan($siteIdAndRating); diff --git a/public/torrentrss.php b/public/torrentrss.php index 22d06a3b..61684422 100644 --- a/public/torrentrss.php +++ b/public/torrentrss.php @@ -171,15 +171,14 @@ if ($where) { } } $sort = "id desc"; -$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"; -//$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"; +$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"; if (!$noNormalResults) { - $query = "SELECT $fieldStr FROM torrents LEFT JOIN categories ON category = categories.id $normalWhere ORDER BY $sort LIMIT $limit"; + $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"; $normalRows = \Nexus\Database\NexusDB::select($query); } if (!empty($prependIdArr) && $startindex == 0) { $prependIdStr = implode(',', $prependIdArr); - $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)"); + $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)"); } $list = []; foreach ($prependRows as $row) {