diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 02:39:03 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-19 02:39:03 -0400 |
commit | 41e9051f2d809c42c3dfecc2eb11ad544cbd27b7 (patch) | |
tree | e370e08b0e0a45c6eef38704aa2f2b2b0e6d8033 /xsig/src | |
parent | 4b8d314f575d9e893d8dda7431194f8b470fc888 (diff) | |
download | deduper-41e9051f2d809c42c3dfecc2eb11ad544cbd27b7.tar.xz |
You break it, you fix it!
The GUI is now working again, with scanning built-in.
Diffstat (limited to 'xsig/src')
-rw-r--r-- | xsig/src/signature_db.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xsig/src/signature_db.cpp b/xsig/src/signature_db.cpp index 393b756..ba1a372 100644 --- a/xsig/src/signature_db.cpp +++ b/xsig/src/signature_db.cpp @@ -214,6 +214,22 @@ void signature_db::batch_get_signature_end() p->batch_end(batch_status::getsig); } +std::vector<size_t> signature_db::get_image_ids() +{ + sqlite3_stmt *st = nullptr; + sqlite3_prepare_v2(p->db, "select id from images;", -1, &st, 0); + std::vector<size_t> ret; + while (1) + { + int r = sqlite3_step(st); + if (r != SQLITE_ROW) break; + size_t id = (size_t)sqlite3_column_int(st, 0); + ret.push_back(id); + } + sqlite3_finalize(st); + return ret; +} + void signature_db::batch_put_subslice_begin() { if (!p->db) [[ unlikely ]] return; |