diff --git a/internal/vaultik/snapshot.go b/internal/vaultik/snapshot.go index a77818c..4d953dd 100644 --- a/internal/vaultik/snapshot.go +++ b/internal/vaultik/snapshot.go @@ -579,7 +579,11 @@ func (v *Vaultik) PurgeSnapshots(keepLatest bool, olderThan string, force bool) // VerifySnapshot checks snapshot integrity func (v *Vaultik) VerifySnapshot(snapshotID string, deep bool) error { - return v.VerifySnapshotWithOptions(snapshotID, &VerifyOptions{Deep: deep}) + opts := &VerifyOptions{Deep: deep} + if deep { + return v.RunDeepVerify(snapshotID, opts) + } + return v.VerifySnapshotWithOptions(snapshotID, opts) } // VerifySnapshotWithOptions checks snapshot integrity with full options @@ -652,25 +656,16 @@ func (v *Vaultik) VerifySnapshotWithOptions(snapshotID string, opts *VerifyOptio for _, blob := range manifest.Blobs { blobPath := fmt.Sprintf("blobs/%s/%s/%s", blob.Hash[:2], blob.Hash[2:4], blob.Hash) - if opts.Deep { - // Download and verify hash - // TODO: Implement deep verification + // Just check existence (deep verification is handled by RunDeepVerify) + _, err := v.Storage.Stat(v.ctx, blobPath) + if err != nil { if !opts.JSON { - fmt.Printf("Deep verification not yet implemented\n") + fmt.Printf(" Missing: %s (%s)\n", blob.Hash, humanize.Bytes(uint64(blob.CompressedSize))) } - return nil + missing++ + missingSize += blob.CompressedSize } else { - // Just check existence - _, err := v.Storage.Stat(v.ctx, blobPath) - if err != nil { - if !opts.JSON { - fmt.Printf(" Missing: %s (%s)\n", blob.Hash, humanize.Bytes(uint64(blob.CompressedSize))) - } - missing++ - missingSize += blob.CompressedSize - } else { - verified++ - } + verified++ } }