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.
|
// JOIN source — callers already fall back gracefully on an empty Channel.
|
||||||
type SummaryRow struct {
|
type SummaryRow struct {
|
||||||
VideoID string
|
VideoID string
|
||||||
|
ProviderVideoID string // videos.provider_video_id; empty when no videos row
|
||||||
Title string // videos.title; 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
|
Channel string // videos.provider for now; empty when no videos row
|
||||||
URL string // videos.url; 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.
|
// crosses users and a missing videos row yields nulls, not a dropped summary.
|
||||||
const selectSummary = `
|
const selectSummary = `
|
||||||
SELECT s.video_id,
|
SELECT s.video_id,
|
||||||
|
COALESCE(v.provider_video_id, ''),
|
||||||
COALESCE(v.title, ''),
|
COALESCE(v.title, ''),
|
||||||
COALESCE(v.provider, ''),
|
COALESCE(v.provider, ''),
|
||||||
COALESCE(v.url, ''),
|
COALESCE(v.url, ''),
|
||||||
@@ -135,6 +137,7 @@ func scanSummaryRow(rows pgx.Row) (SummaryRow, error) {
|
|||||||
)
|
)
|
||||||
if err := rows.Scan(
|
if err := rows.Scan(
|
||||||
&row.VideoID,
|
&row.VideoID,
|
||||||
|
&row.ProviderVideoID,
|
||||||
&row.Title,
|
&row.Title,
|
||||||
&row.Channel,
|
&row.Channel,
|
||||||
&row.URL,
|
&row.URL,
|
||||||
|
|||||||
Reference in New Issue
Block a user