|
|
@ -130,12 +130,8 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) |
|
|
|
// Request valid |
|
|
|
// Request valid |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Download exists, trigger delete |
|
|
|
// Update download stats |
|
|
|
if (!$db->findMagnetDownloadsTotalByUserId($magnet->magnetId, $userId)) |
|
|
|
$db->addMagnetDownload($magnet->magnetId, $userId, time()); |
|
|
|
{ |
|
|
|
|
|
|
|
// Download not exists, add new record |
|
|
|
|
|
|
|
$db->addMagnetDownload($magnet->magnetId, $userId, time()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build magnet link |
|
|
|
// Build magnet link |
|
|
|
$link = []; |
|
|
|
$link = []; |
|
|
@ -210,7 +206,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) |
|
|
|
$uri->value))); |
|
|
|
$uri->value))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Redirect to edit page |
|
|
|
// Return download link |
|
|
|
header( |
|
|
|
header( |
|
|
|
sprintf('Location: %s', implode('&', $link)) |
|
|
|
sprintf('Location: %s', implode('&', $link)) |
|
|
|
); |
|
|
|
); |
|
|
|