select image by hash, for dupe detection
git-svn-id: file:///home/shish/svn/shimmie2/trunk@42 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
fcb79e40c7
commit
4d127b3a17
1 changed files with 6 additions and 0 deletions
|
@ -229,6 +229,12 @@ class Database {
|
|||
return ($row ? new Image($row) : null);
|
||||
}
|
||||
|
||||
public function get_image_by_hash($hash) {
|
||||
$image = null;
|
||||
$row = $this->db->GetRow("SELECT * FROM images WHERE hash=?", array($hash));
|
||||
return ($row ? new Image($row) : null);
|
||||
}
|
||||
|
||||
public function remove_image($id) {
|
||||
$this->db->Execute("DELETE FROM images WHERE id=?", array($id));
|
||||
}
|
||||
|
|
Reference in a new issue