Skip to content

CMRT 20: Feature: Clear and force-reanalyze fingerprint - #26

Open
Swarnadip-Kar wants to merge 4 commits into
cmrt-dialog-acoustid-submitfrom
cmrt-feature-fingerprint-clear-reanalyze
Open

CMRT 20: Feature: Clear and force-reanalyze fingerprint#26
Swarnadip-Kar wants to merge 4 commits into
cmrt-dialog-acoustid-submitfrom
cmrt-feature-fingerprint-clear-reanalyze

Conversation

@Swarnadip-Kar

Copy link
Copy Markdown
Owner

Wipe all fingerprint data fora track so the analyzer
gets a completely fresh slate on the next run.
once the data is gone the existing
hasValidFingerprint() check returns false and the full
pipeline runs normally.

Changes

trackfingerprintdao.h / .cpp

  • clearFingerprintData(TrackId): single-transaction cleanup:
    deleteChromaFile (outside transaction — FS not transactional)
    canonical reassignment or group deletion in cmrt_groups
    DELETE cmrt_members / fingerprint_metadata / acoustid_queue
  • clearAllFingerprintData(): iterates all fingerprinted tracks and
    calls clearFingerprintData(); returns count cleared

wtrackmenu.h / .cpp

  • m_pClearFingerprintAction + slotClearFingerprint(): new "Fingerprint"
    entry in the Clear submenu; uses TrackId + DAO directly, no
    TrackPointerOperation (no in-memory TrackPointer needed)
  • slotClearAllMetadata(): after the existing TrackPointerOperation,
    iterates TrackIds and calls clearFingerprintData() for each — "Clear
    All" must not silently leave fingerprint data behind

dlgpreffingerprint.ui

  • groupBoxClearFingerprints with description label and
    btnClearAllFingerprints; height increased from 280 to 400

dlgpreffingerprint.h / .cpp

  • Constructor now takes TrackCollectionManager* (same pattern as
    DlgPrefLibrary taking Library*) to access the DAO at runtime
  • slotClearAllFingerprints: QMessageBox confirmation (DestructiveRole,
    Cancel default) -> clearAllFingerprintData() -> count summary dialog

dlgpreferences.cpp

  • Updated DlgPrefFingerprint instantiation to pass pLibrary->trackCollectionManager() as third constructor argument

Notes for reviewers

  • deleteChromaFile is called before m_database.transaction() because
    file deletion cannot be rolled back. If the DB transaction later fails
    the file is already gone — the analyzer correctly sees no fingerprint
    on the next run. The reverse order would leave valid DB rows pointing
    at missing files.
  • slotClearFingerprint does not use applyTrackPointerOperation because
    clearFingerprintData needs only a TrackId and DAO — loading an
    in-memory TrackPointer would be wasteful and would hold the cache lock
    during a multi-table DB transaction unnecessarily.
  • The call site that constructs DlgPrefFingerprint must be updated to
    pass TrackCollectionManager*.

Depends on: cmrt-dialog-acoustid-submit (#24)

@coveralls

coveralls commented Jun 8, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27115462417

Coverage decreased (-0.05%) to 30.466%

Details

  • Coverage decreased (-0.05%) from the base build.
  • Patch coverage: 171 uncovered changes across 4 files (0 of 171 lines covered, 0.0%).
  • 8 coverage regressions across 6 files.

Uncovered Changes

File Changed Covered %
src/library/dao/trackfingerprintdao.cpp 120 0 0.0%
src/preferences/dialog/dlgpreffingerprint.cpp 27 0 0.0%
src/widget/wtrackmenu.cpp 20 0 0.0%
src/preferences/dialog/dlgpreferences.cpp 4 0 0.0%

Coverage Regressions

8 previously-covered lines in 6 files lost coverage.

File Lines Losing Coverage Coverage
src/library/queryutil.h 2 58.06%
src/preferences/dialog/dlgpreffingerprint.cpp 2 0.0%
src/preferences/dialog/dlgpreferences.cpp 1 0.0%
src/preferences/dialog/dlgpreffingerprint.h 1 0.0%
src/track/track.cpp 1 61.82%
src/widget/wtrackmenu.cpp 1 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 116143
Covered Lines: 35384
Line Coverage: 30.47%
Coverage Strength: 59311.78 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants