From a7d4749518b9ad43018437aed00607ed075faf41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophanee=20Mayaud?= Date: Mon, 6 Nov 2023 23:33:50 +0100 Subject: [PATCH] feat(cache): can now declaire pair as not duplicates and save to cache --- QtProject/app/comparison.cpp | 12 +++++- QtProject/app/comparison.h | 6 ++- QtProject/app/comparison.ui | 84 ++++++++++++++++++++++++++++++------ QtProject/app/db.cpp | 63 ++++++++++++++++++++++----- QtProject/app/db.h | 7 +++ README.md | 9 +++- 6 files changed, 153 insertions(+), 28 deletions(-) diff --git a/QtProject/app/comparison.cpp b/QtProject/app/comparison.cpp index 36420d0..1024526 100644 --- a/QtProject/app/comparison.cpp +++ b/QtProject/app/comparison.cpp @@ -197,7 +197,9 @@ bool Comparison::bothVideosMatch(const Video *left, const Video *right) return theyMatch; } - // TODO check if pair is flagged as not dupplicate in DB + // check if pair is flagged as not dupplicate in DB + if(Db(_prefs.cacheFilePathName).isPairToIgnore(left->_filePathName, right->_filePathName)) + return false; _phashSimilarity = 0; @@ -1412,3 +1414,11 @@ void Comparison::on_settingNamesInAnotherCheckbox_stateChanged(int arg1) ui->label_namesContainedInOneAnotherStatus_autoIdentFiles->setText(status); ui->label_namesContainedInOneAnotherStatus_autoOnlySizeDiff->setText(status); } + +void Comparison::on_ignoreDuplicatePairButton_clicked() +{ + Db cache(_prefs.cacheFilePathName); // opening connexion to database + cache.writePairToIgnore(_videos[_leftVideo]->_filePathName, _videos[_rightVideo]->_filePathName); + on_nextVideo_clicked(); +} + diff --git a/QtProject/app/comparison.h b/QtProject/app/comparison.h index 77e99ff..39c2470 100644 --- a/QtProject/app/comparison.h +++ b/QtProject/app/comparison.h @@ -38,8 +38,8 @@ class Comparison : public QDialog QVector