* Reads the optional `publishedAfter` cutoff from sourceConfig as a timestamp (ms), * or null when unset/invalid.
(sourceConfig: Record<string, unknown>)
| 180 | * or null when unset/invalid. |
| 181 | */ |
| 182 | function getPublishedAfter(sourceConfig: Record<string, unknown>): number | null { |
| 183 | const raw = (sourceConfig.publishedAfter as string | undefined)?.trim() |
| 184 | if (!raw) return null |
| 185 | const ms = new Date(raw).getTime() |
| 186 | return Number.isNaN(ms) ? null : ms |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * Builds a metadata-only stub from a playlist item. |