fix: recording not being sent if mail enable was not checked
This commit is contained in:
@@ -497,6 +497,31 @@ var uploadStatusCols = map[string]bool{
|
||||
|
||||
// ListForUpload returns QSOs whose per-service sent-status column equals
|
||||
// value ("" matches blank/NULL). Used by the QSL Manager's "Select required".
|
||||
// ListForUploadFull is like ListForUpload but returns FULL QSO rows so the UI
|
||||
// can show the same rich, column-pickable table as Recent QSOs. column is an
|
||||
// upload-status column (validated); value is the status to match ("" = not yet
|
||||
// uploaded).
|
||||
func (r *Repo) ListForUploadFull(ctx context.Context, column, value string) ([]QSO, error) {
|
||||
if !uploadStatusCols[column] {
|
||||
return nil, fmt.Errorf("invalid upload column %q", column)
|
||||
}
|
||||
rows, err := r.db.QueryContext(ctx,
|
||||
`SELECT `+selectCols+` FROM qso WHERE COALESCE(`+column+`,'') = ? ORDER BY qso_date DESC, id DESC`, value)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("list for upload: %w", err)
|
||||
}
|
||||
defer rows.Close()
|
||||
out := make([]QSO, 0, 64)
|
||||
for rows.Next() {
|
||||
q, err := scanQSO(rows)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, q)
|
||||
}
|
||||
return out, rows.Err()
|
||||
}
|
||||
|
||||
func (r *Repo) ListForUpload(ctx context.Context, column, value string) ([]UploadRow, error) {
|
||||
if !uploadStatusCols[column] {
|
||||
return nil, fmt.Errorf("invalid upload column %q", column)
|
||||
|
||||
Reference in New Issue
Block a user