Manifest validity check — correct nasArchiveTotal when manifest has ≤1 entry #1

Closed
opened 2026-05-18 07:32:14 +00:00 by kutesir · 0 comments
Owner

Problem

If the NAS manifest exists but has ≤ 1 entry (corrupted, newly created, or written empty mid-backup), buildManifestIndex uses it as-is. nasArchiveTotal shows 1 even though hundreds of files exist on NAS.

Fix

In BackupStatusService.buildManifestIndex, after decoding the manifest: if manifest.entries.count <= 1, call transfer.listDirectory and use max(manifest.entries.count, directoryMediaCount) as a display floor for nasArchiveTotal.

Critical: Do NOT add directory files as orphan ManifestEntry objects — this previously inflated archive count to 7421 (other devices files in the folder). Use directory count only for the UI display number.

Acceptance

  • Manifest with 1 real entry on a NAS with 260 media files → NAS Archive shows ~260
  • Manifest with 300 entries → no directory scan, unchanged
  • manifest.entries count is never inflated by this fix
## Problem If the NAS manifest exists but has ≤ 1 entry (corrupted, newly created, or written empty mid-backup), `buildManifestIndex` uses it as-is. `nasArchiveTotal` shows 1 even though hundreds of files exist on NAS. ## Fix In `BackupStatusService.buildManifestIndex`, after decoding the manifest: if `manifest.entries.count <= 1`, call `transfer.listDirectory` and use `max(manifest.entries.count, directoryMediaCount)` as a display floor for `nasArchiveTotal`. **Critical:** Do NOT add directory files as orphan `ManifestEntry` objects — this previously inflated archive count to 7421 (other devices files in the folder). Use directory count only for the UI display number. ## Acceptance - Manifest with 1 real entry on a NAS with 260 media files → NAS Archive shows ~260 - Manifest with 300 entries → no directory scan, unchanged - `manifest.entries` count is never inflated by this fix
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kutesir/Kisani#1
No description provided.