Browse Source

add magnet timeUpdated support, add updateMagnetXl method

main
ghost 1 year ago
parent
commit
5b9e5e9f25
  1. 20
      src/library/database.php

20
src/library/database.php

@ -595,7 +595,8 @@ class Database { @@ -595,7 +595,8 @@ class Database {
bool $comments,
bool $sensitive,
bool $approved,
int $timeAdded) : int {
int $timeAdded,
mixed $timeUpdated = null) : int {
$this->_debug->query->insert->total++;
@ -607,7 +608,8 @@ class Database { @@ -607,7 +608,8 @@ class Database {
`comments` = ?,
`sensitive` = ?,
`approved` = ?,
`timeAdded` = ?');
`timeAdded` = ?,
`timeUpdated` = ?');
$query->execute(
[
@ -619,7 +621,8 @@ class Database { @@ -619,7 +621,8 @@ class Database {
$comments ? 1 : 0,
$sensitive ? 1 : 0,
$approved ? 1 : 0,
$timeAdded
$timeAdded,
$timeUpdated
]
);
@ -705,6 +708,17 @@ class Database { @@ -705,6 +708,17 @@ class Database {
return $query->fetch()->result;
}
public function updateMagnetXl(int $magnetId, int $xl, int $timeUpdated) : int {
$this->_debug->query->update->total++;
$query = $this->_db->prepare('UPDATE `magnet` SET `xl` = ?, `timeUpdated` = ? WHERE `magnetId` = ?');
$query->execute([$xl, $timeUpdated, $magnetId]);
return $query->rowCount();
}
public function updateMagnetDn(int $magnetId, string $dn, int $timeUpdated) : int {
$this->_debug->query->update->total++;

Loading…
Cancel
Save