Delete livephoto entries on deletion

pull/245/head
Varun Patil 2022-11-23 10:40:41 -08:00
parent ced6e1380d
commit b81d9c1df6
1 changed files with 9 additions and 5 deletions

View File

@ -199,11 +199,15 @@ class TimelineWrite
*/
public function deleteFile(File &$file)
{
$query = $this->connection->getQueryBuilder();
$query->delete('memories')
->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT)))
;
$query->executeStatement();
$deleteFrom = function ($table) use (&$file) {
$query = $this->connection->getQueryBuilder();
$query->delete($table)
->where($query->expr()->eq('fileid', $query->createNamedParameter($file->getId(), IQueryBuilder::PARAM_INT)))
;
$query->executeStatement();
};
$deleteFrom('memories');
$deleteFrom('memories_livephoto');
}
/**