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:
shish 2007-05-01 12:40:39 +00:00
parent fcb79e40c7
commit 4d127b3a17

View file

@ -229,6 +229,12 @@ class Database {
return ($row ? new Image($row) : null); 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) { public function remove_image($id) {
$this->db->Execute("DELETE FROM images WHERE id=?", array($id)); $this->db->Execute("DELETE FROM images WHERE id=?", array($id));
} }