/** * dequeueTorrent * @param $torrent name of the torrent */ function dequeueTorrent($torrent) { $torrent = urldecode($torrent); $alias_file = getRequestVar('alias_file'); if (isTorrentRunning($torrent)) { // torrent has been started... try and kill it. AuditAction($this->cfg["constants"]["unqueued_torrent"], $torrent . "has been started -- TRY TO KILL IT"); header("location: index.php?alias_file=" . $alias_file . "&kill=true&kill_torrent=" . urlencode($torrent)); exit; } else { if ($this->isQueueManagerRunning()) { // send command to daemon $this->sendQueueCommand('remove ' . substr($torrent, 0, -8)); // flag the torrent as stopped (in db) stopTorrentSettings($torrent); // update the stat file. parent::updateStatFile($torrent, $alias_file); // log AuditAction($this->cfg["constants"]["unqueued_torrent"], $torrent); } else { header("location: admin.php?op=queueSettings"); exit; } } }
/** * dequeueTorrent * @param $torrent name of the torrent */ function dequeueTorrent($torrent) { $torrent = urldecode($torrent); $alias_file = getRequestVar('alias_file'); // Is the Qinfo file still there? if (file_exists($this->cfg["torrent_file_path"] . "queue/" . $alias_file . ".Qinfo")) { // flag the torrent as stopped (in db) stopTorrentSettings($torrent); // update the stat file. parent::updateStatFile($torrent, $alias_file); // Remove Qinfo file. @unlink($this->cfg["torrent_file_path"] . "queue/" . $alias_file . ".Qinfo"); // log AuditAction($this->cfg["constants"]["unqueued_torrent"], $torrent); } else { // torrent has been started... try and kill it. AuditAction($this->cfg["constants"]["unqueued_torrent"], $torrent . "has been started -- TRY TO KILL IT"); header("location: index.php?alias_file=" . $alias_file . "&kill=true&kill_torrent=" . urlencode($torrent)); exit; } }