|
@@ -74,6 +74,7 @@ if (isset($_POST['release'])) {
|
74
|
74
|
|
75
|
75
|
$Properties['GroupDescription'] = trim($_POST['album_desc']);
|
76
|
76
|
$Properties['TorrentDescription'] = $_POST['release_desc'];
|
|
77
|
+$Properties['MediaInfo'] = '';
|
77
|
78
|
#$Properties['MediaInfo'] = $_POST['mediainfo'];
|
78
|
79
|
$Properties['Screenshots'] = isset($_POST['screenshots']) ? $_POST['screenshots'] : "";
|
79
|
80
|
|
|
@@ -81,6 +82,7 @@ if ($_POST['album_desc']) {
|
81
|
82
|
$Properties['GroupDescription'] = trim($_POST['album_desc']);
|
82
|
83
|
} elseif ($_POST['desc']) {
|
83
|
84
|
$Properties['GroupDescription'] = trim($_POST['desc']);
|
|
85
|
+ $Properties['MediaInfo'] = '';
|
84
|
86
|
#$Properties['MediaInfo'] = $_POST['mediainfo'];
|
85
|
87
|
}
|
86
|
88
|
|
|
@@ -150,7 +152,7 @@ switch ($Type) {
|
150
|
152
|
|
151
|
153
|
$Validate->SetFields('release_desc',
|
152
|
154
|
'0','string','The release description has a minimum length of 10 characters.', array('maxlength'=>1000000, 'minlength'=>10));
|
153
|
|
- */
|
|
155
|
+ */
|
154
|
156
|
|
155
|
157
|
default:
|
156
|
158
|
if (!isset($_POST['groupid']) || !$_POST['groupid']) {
|
|
@@ -375,20 +377,6 @@ if ((!isset($GroupID) || !$GroupID)) {
|
375
|
377
|
if (!isset($GroupID) || !$GroupID) {
|
376
|
378
|
// Create torrent group
|
377
|
379
|
$DB->query("
|
378
|
|
- INSERT INTO torrents_group
|
379
|
|
- (CategoryID, Name, NameRJ, NameJP, Year,
|
380
|
|
- Series, Studio, CatalogueNumber, Pages, Time,
|
381
|
|
- WikiBody, WikiImage)
|
382
|
|
- VALUES
|
383
|
|
- ( ?, ?, ?, ?, ?,
|
384
|
|
- ?, ?, ?, ?, NOW(),
|
385
|
|
- ?, ? )",
|
386
|
|
- $TypeID, $T['Title'], $T['TitleRJ'], $T['TitleJP'], $T['Year'],
|
387
|
|
- $T['Series'], $T['Studio'], $T['CatalogueNumber'], $T['Pages'],
|
388
|
|
- $Body, $T['Image']);
|
389
|
|
-
|
390
|
|
- /* Original DB query
|
391
|
|
- $DB->query("
|
392
|
380
|
INSERT INTO torrents_group
|
393
|
381
|
(CategoryID, Name, NameRJ, NameJP, Year,
|
394
|
382
|
Series, Studio, CatalogueNumber, Pages, Time,
|
|
@@ -400,8 +388,6 @@ if (!isset($GroupID) || !$GroupID) {
|
400
|
388
|
$TypeID, $T['Title'], $T['TitleRJ'], $T['TitleJP'], $T['Year'],
|
401
|
389
|
$T['Series'], $T['Studio'], $T['CatalogueNumber'], $T['Pages'],
|
402
|
390
|
$Body, $T['Image'], $T['DLsiteID']);
|
403
|
|
- */
|
404
|
|
-
|
405
|
391
|
$GroupID = $DB->inserted_id();
|
406
|
392
|
foreach ($ArtistForm as $Num => $Artist) {
|
407
|
393
|
$DB->query("
|
|
@@ -512,20 +498,6 @@ if (($Type == 'Movies' || $Type == 'Anime') && ($T['Container'] == 'ISO' || $T['
|
512
|
498
|
|
513
|
499
|
// Torrent
|
514
|
500
|
$DB->query("
|
515
|
|
- INSERT INTO torrents
|
516
|
|
- (GroupID, UserID, Media, Container, Codec, Resolution,
|
517
|
|
- Anonymous, Archive, info_hash, FileCount, FileList, FilePath, Size, Time,
|
518
|
|
- Description, FreeTorrent, FreeLeechType)
|
519
|
|
- VALUES
|
520
|
|
- ( ?, ?, ?, ?, ?, ?,
|
521
|
|
- ?, ?, ?, ?, ?, ?, ?, NOW(),
|
522
|
|
- ?, ?, ? )",
|
523
|
|
- $GroupID, $LoggedUser['ID'], $T['Media'], $T['Container'], $T['Codec'], $T['Resolution'],
|
524
|
|
- $T['Anonymous'], $T['Archive'], $InfoHash, $NumFiles, $FileString, $FilePath, $TotalSize,
|
525
|
|
- $T['TorrentDescription'], $T['FreeTorrent'], $T['FreeLeechType']);
|
526
|
|
-
|
527
|
|
- /* Original DB query
|
528
|
|
- $DB->query("
|
529
|
501
|
INSERT INTO torrents
|
530
|
502
|
(GroupID, UserID, Media, Container, Codec, Resolution,
|
531
|
503
|
AudioFormat, Subbing, Language, Subber, Censored,
|
|
@@ -540,28 +512,17 @@ $DB->query("
|
540
|
512
|
$T['AudioFormat'], $T['Subbing'], $T['Language'], $T['Subber'], $T['Censored'],
|
541
|
513
|
$T['Anonymous'], $T['Archive'], $InfoHash, $NumFiles, $FileString, $FilePath, $TotalSize,
|
542
|
514
|
$T['TorrentDescription'], $T['MediaInfo'], $T['FreeTorrent'], $T['FreeLeechType']);
|
543
|
|
- */
|
544
|
515
|
|
545
|
516
|
$Cache->increment('stats_torrent_count');
|
546
|
517
|
$TorrentID = $DB->inserted_id();
|
547
|
518
|
$Tor->Dec['comment'] = 'https://'.SITE_DOMAIN.'/torrents.php?torrentid='.$TorrentID;
|
548
|
519
|
|
549
|
|
-# Mitigate $TorrentID = 0 bug on some uploads
|
550
|
|
-# @todo Investigate this further and properly fix
|
551
|
|
-if ($TorrentID !== 0) {
|
552
|
|
- Tracker::update_tracker('add_torrent', [
|
553
|
|
- 'id' => $TorrentID,
|
554
|
|
- 'info_hash' => rawurlencode($InfoHash),
|
555
|
|
- 'freetorrent' => $T['FreeTorrent']
|
556
|
|
- ]);
|
557
|
|
- $Debug->set_flag('upload: ocelot updated');
|
558
|
|
-} else {
|
559
|
|
- $TorrentID_debug = $DB->query("
|
560
|
|
- SELECT MAX(ID) FROM torrents
|
561
|
|
- ");
|
562
|
|
- var_dump($TorrentID_debug);
|
563
|
|
- error(0);
|
564
|
|
-}
|
|
520
|
+Tracker::update_tracker('add_torrent', [
|
|
521
|
+ 'id' => $TorrentID,
|
|
522
|
+ 'info_hash' => rawurlencode($InfoHash),
|
|
523
|
+ 'freetorrent' => $T['FreeTorrent']
|
|
524
|
+]);
|
|
525
|
+$Debug->set_flag('upload: ocelot updated');
|
565
|
526
|
|
566
|
527
|
// Prevent deletion of this torrent until the rest of the upload process is done
|
567
|
528
|
// (expire the key after 10 minutes to prevent locking it for too long in case there's a fatal error below)
|