diff --git a/internal/recorder/list.go b/internal/recorder/list.go index ccd45b0..e4445b6 100644 --- a/internal/recorder/list.go +++ b/internal/recorder/list.go @@ -12,6 +12,7 @@ type Recording struct { ID string `json:"id"` Start time.Time `json:"start"` CenterHz float64 `json:"center_hz"` + EventID int64 `json:"event_id"` Path string `json:"path"` } @@ -38,7 +39,7 @@ func ListRecordings(root string) ([]Recording, error) { if err := json.Unmarshal(b, &m); err != nil { continue } - out = append(out, Recording{ID: id, Start: m.Start, CenterHz: m.CenterHz, Path: filepath.Join(root, id)}) + out = append(out, Recording{ID: id, Start: m.Start, CenterHz: m.CenterHz, EventID: m.EventID, Path: filepath.Join(root, id)}) } sort.Slice(out, func(i, j int) bool { return out[i].Start.After(out[j].Start) }) return out, nil diff --git a/web/app.js b/web/app.js index 989ecc2..00942ac 100644 --- a/web/app.js +++ b/web/app.js @@ -1138,7 +1138,7 @@ if (decodeEventBtn) { const ev = eventsById.get(selectedEventId); if (!ev) return; if (!recordingMetaEl) return; - const rec = recordings.find(r => r.center_hz === ev.center_hz); + const rec = recordings.find(r => r.event_id === ev.id) || recordings.find(r => r.center_hz === ev.center_hz); if (!rec) { decodeResultEl.textContent = 'Decode: no recording'; return;