Makes the YouTube dumps posted with a start time, before the YouTube provider kept it, start there instead of at 0:00. rich_content.embedUrl is computed when a dump is posted, and it used to drop the source URL's t (?t=1265, ?t=1h2m3s); this adds the start parameter back to the stored embed URLs.

It reads the time from the stored source URL and fetches nothing. It keeps its own copy of the parsing, so that it migrates every database alike should the provider's change.

Functions

f
up(db: DatabaseSync): void

Run once by runMigrations. It leaves alone an embed URL that already has a start, and a row whose rich_content doesn't parse.

Usage

import * as mod from "api/db/migrations/0010_youtube_embed_start.ts";