diff --git a/tui/backup-tui b/tui/backup-tui index dc6cb60..df402d0 100755 Binary files a/tui/backup-tui and b/tui/backup-tui differ diff --git a/tui/main.go b/tui/main.go index 006ffd7..00ec5e5 100644 --- a/tui/main.go +++ b/tui/main.go @@ -819,6 +819,12 @@ func (m *Model) showBackupDetails(details BackupDetails) { // Directory summary content.WriteString("📊 Directory Summary:\n") content.WriteString(fmt.Sprintf(" 📁 Path: %s\n", details.Directory.Path)) + + // Show if this is using a scheduled subfolder + if strings.HasSuffix(details.Directory.Path, "/scheduled") { + content.WriteString(" 📅 Source: Scheduled backups (from 'scheduled' subfolder)\n") + } + content.WriteString(fmt.Sprintf(" 📄 Files: %d\n", details.TotalFiles)) content.WriteString(fmt.Sprintf(" 💾 Total Size: %s\n", formatSize(details.TotalSize))) @@ -925,9 +931,17 @@ func formatSize(bytes int64) string { // loadBackupDirectory loads backup files from a directory func (m *Model) loadBackupDirectory(dirPath string) tea.Cmd { return func() tea.Msg { - files, err := os.ReadDir(dirPath) + // Check if there's a "scheduled" subfolder - if so, use that instead + scheduledPath := filepath.Join(dirPath, "scheduled") + actualPath := dirPath + + if info, err := os.Stat(scheduledPath); err == nil && info.IsDir() { + actualPath = scheduledPath + } + + files, err := os.ReadDir(actualPath) if err != nil { - return errorMsg{error: fmt.Sprintf("Failed to read directory %s: %v", dirPath, err)} + return errorMsg{error: fmt.Sprintf("Failed to read directory %s: %v", actualPath, err)} } var backupFiles []BackupFile @@ -946,11 +960,11 @@ func (m *Model) loadBackupDirectory(dirPath string) tea.Cmd { backupFile := BackupFile{ Name: file.Name(), - Path: filepath.Join(dirPath, file.Name()), + Path: filepath.Join(actualPath, file.Name()), Size: info.Size(), ModifiedTime: info.ModTime(), IsCompressed: strings.HasSuffix(file.Name(), ".tar.gz") || strings.HasSuffix(file.Name(), ".zip"), - Service: filepath.Base(dirPath), + Service: filepath.Base(dirPath), // Keep using original dirPath for service name } backupFiles = append(backupFiles, backupFile) @@ -975,7 +989,7 @@ func (m *Model) loadBackupDirectory(dirPath string) tea.Cmd { details := BackupDetails{ Directory: BackupDirectory{ Name: filepath.Base(dirPath), - Path: dirPath, + Path: actualPath, // Show the actual path where files are located FileCount: len(backupFiles), TotalSize: totalSize, LastModified: lastModified,