|
@@ -2,10 +2,6 @@
|
2
|
2
|
|
3
|
3
|
require(SERVER_ROOT.'/sections/torrents/functions.php');
|
4
|
4
|
|
5
|
|
-// Seriously what the hell do these do
|
6
|
|
-$GroupAllowed = array('WikiBody', 'WikiImage', 'ID', 'Name', 'Year', 'RecordLabel', 'CatalogueNumber', 'ReleaseType', 'CategoryID', 'Time', 'VanityHouse');
|
7
|
|
-$TorrentAllowed = array('ID', 'Media', 'Format', 'Encoding', 'Remastered', 'RemasterYear', 'RemasterTitle', 'RemasterRecordLabel', 'RemasterCatalogueNumber', 'Scene', 'HasLog', 'HasCue', 'LogScore', 'FileCount', 'Size', 'Seeders', 'Leechers', 'Snatched', 'FreeTorrent', 'Time', 'Description', 'FileList', 'FilePath', 'UserID', 'Username');
|
8
|
|
-
|
9
|
5
|
$GroupID = (int)$_GET['id'];
|
10
|
6
|
$TorrentHash = (string)$_GET['hash'];
|
11
|
7
|
|
|
@@ -36,7 +32,7 @@ if (!$TorrentCache) {
|
36
|
32
|
|
37
|
33
|
list($TorrentDetails, $TorrentList) = $TorrentCache;
|
38
|
34
|
|
39
|
|
-$Artiss = pullmediainfo(Artists::get_artist($GroupID));
|
|
35
|
+$Artists = pullmediainfo(Artists::get_artist($GroupID));
|
40
|
36
|
|
41
|
37
|
if ($TorrentDetails['CategoryID'] == 0) {
|
42
|
38
|
$CategoryName = 'Unknown';
|
|
@@ -46,7 +42,7 @@ if ($TorrentDetails['CategoryID'] == 0) {
|
46
|
42
|
|
47
|
43
|
$TagList = explode('|', $TorrentDetails['GROUP_CONCAT(DISTINCT tags.Name SEPARATOR \'|\')']);
|
48
|
44
|
|
49
|
|
-$JsonTorrentDetails = array(
|
|
45
|
+$JsonTorrentDetails = [
|
50
|
46
|
'wikiBody' => Text::full_format($TorrentDetails['WikiBody']),
|
51
|
47
|
'wikiImage' => $TorrentDetails['WikiImage'],
|
52
|
48
|
'id' => (int)$TorrentDetails['ID'],
|
|
@@ -62,7 +58,7 @@ $JsonTorrentDetails = array(
|
62
|
58
|
'time' => $TorrentDetails['Time'],
|
63
|
59
|
'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
|
64
|
60
|
'tags' => $TagList
|
65
|
|
-);
|
|
61
|
+];
|
66
|
62
|
|
67
|
63
|
$JsonTorrentList = [];
|
68
|
64
|
foreach ($TorrentList as $Torrent) {
|
|
@@ -76,7 +72,7 @@ foreach ($TorrentList as $Torrent) {
|
76
|
72
|
$Userinfo = Users::user_info($Torrent['UserID']);
|
77
|
73
|
$Reports = Torrents::get_reports($Torrent['ID']);
|
78
|
74
|
$Torrent['Reported'] = count($Reports) > 0;
|
79
|
|
- $JsonTorrentList[] = array(
|
|
75
|
+ $JsonTorrentList[] = [
|
80
|
76
|
'id' => (int)$Torrent['ID'],
|
81
|
77
|
'infoHash' => $Torrent['InfoHash'],
|
82
|
78
|
'media' => $Torrent['Media'],
|
|
@@ -85,7 +81,7 @@ foreach ($TorrentList as $Torrent) {
|
85
|
81
|
'resolution' => $Torrent['Resolution'],
|
86
|
82
|
'audioFormat' => $Torrent['AudioFormat'],
|
87
|
83
|
'subbing' => $Torrent['Subbing'],
|
88
|
|
- 'subber' => $Torrent['Subber']
|
|
84
|
+ 'subber' => $Torrent['Subber'],
|
89
|
85
|
'language' => $Torrent['Language'],
|
90
|
86
|
'censored' => (bool)$Torrent['Censored'],
|
91
|
87
|
'archive' => $Torrent['Archive'],
|
|
@@ -103,7 +99,7 @@ foreach ($TorrentList as $Torrent) {
|
103
|
99
|
'filePath' => $Torrent['FilePath'],
|
104
|
100
|
'userId' => (int)$Torrent['UserID'],
|
105
|
101
|
'username' => $Userinfo['Username']
|
106
|
|
- );
|
|
102
|
+ ];
|
107
|
103
|
}
|
108
|
104
|
|
109
|
|
-json_die("success", array('group' => $JsonTorrentDetails, 'torrents' => $JsonTorrentList));
|
|
105
|
+json_die("success", ['group' => $JsonTorrentDetails, 'torrents' => $JsonTorrentList]);
|