Text::full_format($TorrentDetails['WikiBody']), 'wikiImage' => $TorrentDetails['WikiImage'], 'id' => (int)$TorrentDetails['ID'], 'name' => $TorrentDetails['Name'], 'namejp' => $TorrentDetails['NameJP'], 'artists' => $Artists, 'year' => (int)$TorrentDetails['Year'], 'catalogueNumber' => $TorrentDetails['CatalogueNumber'], 'pages' => (int)$TorrentDetails['Pages'], 'categoryId' => (int)$TorrentDetails['CategoryID'], 'categoryName' => $CategoryName, 'dlsiteId' => $TorrentDetails['DLSiteID'], 'time' => $TorrentDetails['Time'], 'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID), 'tags' => $TagList ); $JsonTorrentList = array(); foreach ($TorrentList as $Torrent) { // Convert file list back to the old format $FileList = explode("\n", $Torrent['FileList']); foreach ($FileList as &$File) { $File = Torrents::filelist_old_format($File); } unset($File); $FileList = implode('|||', $FileList); $Userinfo = Users::user_info($Torrent['UserID']); $Reports = Torrents::get_reports($Torrent['ID']); $Torrent['Reported'] = count($Reports) > 0; $JsonTorrentList[] = array( 'id' => (int)$Torrent['ID'], 'infoHash' => $Torrent['InfoHash'], 'media' => $Torrent['Media'], 'container' => $Torrent['Container'], 'codec' => $Torrent['Codec'], 'resolution' => $Torrent['Resolution'], 'audioFormat' => $Torrent['AudioFormat'], 'subbing' => $Torrent['Subbing'], 'subber' => $Torrent['Subber'] 'language' => $Torrent['Language'], 'censored' => (bool)$Torrent['Censored'], 'archive' => $Torrent['Archive'], 'fileCount' => (int)$Torrent['FileCount'], 'size' => (int)$Torrent['Size'], 'seeders' => (int)$Torrent['Seeders'], 'leechers' => (int)$Torrent['Leechers'], 'snatched' => (int)$Torrent['Snatched'], 'freeTorrent' => $Torrent['FreeTorrent'] == 1, 'reported' => $Torrent['Reported'], 'time' => $Torrent['Time'], 'description' => $Torrent['Description'], 'mediaInfo' => $Torrent['MediaInfo'], 'fileList' => $FileList, 'filePath' => $Torrent['FilePath'], 'userId' => (int)$Torrent['UserID'], 'username' => $Userinfo['Username'] ); } json_die("success", array('group' => $JsonTorrentDetails, 'torrents' => $JsonTorrentList));