mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 09:35:28 +00:00
add magnet comments, downloads, views, stars import support
This commit is contained in:
parent
22655dc71b
commit
dd96d56fcc
2 changed files with 211 additions and 4 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue