feat(store): expose provider_video_id on SummaryRow
Read-only addition (column + field + scan) so the web layer can build a video embed URL. No write-path or restructuring.
This commit is contained in:
@@ -26,6 +26,7 @@ var ErrNotFound = errors.New("store: summary not found")
|
||||
// JOIN source — callers already fall back gracefully on an empty Channel.
|
||||
type SummaryRow struct {
|
||||
VideoID string
|
||||
ProviderVideoID string // videos.provider_video_id; empty when no videos row
|
||||
Title string // videos.title; empty when no videos row
|
||||
Channel string // videos.provider for now; empty when no videos row
|
||||
URL string // videos.url; empty when no videos row
|
||||
@@ -45,6 +46,7 @@ type SummaryRow struct {
|
||||
// crosses users and a missing videos row yields nulls, not a dropped summary.
|
||||
const selectSummary = `
|
||||
SELECT s.video_id,
|
||||
COALESCE(v.provider_video_id, ''),
|
||||
COALESCE(v.title, ''),
|
||||
COALESCE(v.provider, ''),
|
||||
COALESCE(v.url, ''),
|
||||
@@ -135,6 +137,7 @@ func scanSummaryRow(rows pgx.Row) (SummaryRow, error) {
|
||||
)
|
||||
if err := rows.Scan(
|
||||
&row.VideoID,
|
||||
&row.ProviderVideoID,
|
||||
&row.Title,
|
||||
&row.Channel,
|
||||
&row.URL,
|
||||
|
||||
Reference in New Issue
Block a user