diff --git a/database/yggtracker.mwb b/database/yggtracker.mwb index effaf82..5556714 100644 Binary files a/database/yggtracker.mwb and b/database/yggtracker.mwb differ diff --git a/src/public/action.php b/src/public/action.php index 30bbd9e..9ceba22 100644 --- a/src/public/action.php +++ b/src/public/action.php @@ -130,12 +130,8 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) // Request valid else { - // Download exists, trigger delete - if (!$db->findMagnetDownloadsTotalByUserId($magnet->magnetId, $userId)) - { - // Download not exists, add new record - $db->addMagnetDownload($magnet->magnetId, $userId, time()); - } + // Update download stats + $db->addMagnetDownload($magnet->magnetId, $userId, time()); // Build magnet link $link = []; @@ -210,7 +206,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false) $uri->value))); } - // Redirect to edit page + // Return download link header( sprintf('Location: %s', implode('&', $link)) );