add magnet comments, downloads, views, stars import support

This commit is contained in:
ghost 2023-09-14 18:33:10 +03:00
parent 22655dc71b
commit dd96d56fcc
2 changed files with 211 additions and 4 deletions

View file

@ -1377,6 +1377,17 @@ class Database {
return $query->fetchAll();
}
public function findMagnetComment(int $magnetId, int $userId, int $timeAdded) {
$this->_debug->query->select->total++;
$query = $this->_db->prepare('SELECT * FROM `magnetComment` WHERE `magnetId` = ? AND `userId` = ? AND `timeAdded` = ?');
$query->execute([$magnetId, $userId, $timeAdded]);
return $query->fetch();
}
public function getMagnetComment(int $magnetCommentId) {
$this->_debug->query->select->total++;
@ -1466,6 +1477,17 @@ class Database {
return $query->fetch()->result;
}
public function findMagnetStar(int $magnetId, int $userId, int $timeAdded) {
$this->_debug->query->select->total++;
$query = $this->_db->prepare('SELECT * FROM `magnetStar` WHERE `magnetId` = ? AND `userId` = ? AND `timeAdded` = ?');
$query->execute([$magnetId, $userId, $timeAdded]);
return $query->fetch();
}
// Magnet download
public function addMagnetDownload(int $magnetId, int $userId, int $timeAdded) : int {
@ -1507,6 +1529,17 @@ class Database {
return $query->fetch()->result;
}
public function findMagnetDownload(int $magnetId, int $userId, int $timeAdded) {
$this->_debug->query->select->total++;
$query = $this->_db->prepare('SELECT * FROM `magnetDownload` WHERE `magnetId` = ? AND `userId` = ? AND `timeAdded` = ?');
$query->execute([$magnetId, $userId, $timeAdded]);
return $query->fetch();
}
public function findMagnetDownloadsTotalByMagnetId(int $magnetId) : int {
$this->_debug->query->select->total++;
@ -1595,4 +1628,15 @@ class Database {
return $query->fetch()->result;
}
public function findMagnetView(int $magnetId, int $userId, int $timeAdded) {
$this->_debug->query->select->total++;
$query = $this->_db->prepare('SELECT * FROM `magnetView` WHERE `magnetId` = ? AND `userId` = ? AND `timeAdded` = ?');
$query->execute([$magnetId, $userId, $timeAdded]);
return $query->fetch();
}
}