We should be referencing media_sources by their ID on programs,
external_ids, etc. This enables us to use proper foreign keys for
referential integrity at the DB level, not worry about unique names for
media sources, and simplifies a lot of the code relating to media source
deletion and the cleanup thereafter.
This change also introduces the DBContext, which should allow for
arbitrarily calling other DB accessor functions when within transactions
and not deadlocking the connection to the DB.
* Updates Typescript to latest version
* Changes server Typescript config to actually emit JS files. We were
already running a full tsc invocation against the server for
typechecking anyway... and we use tsx for fast dev iteration w/o
typechecking, so we may as well just emit the actual JS files so that we
can take advantage of thinks like decorator metadata (upcoming inversify
PR...)
* Updates better-sqlite version to latest
* Bumps node version requirement to 22 and codifies it in package.json
engines
* refactor: massive backend refactoring
I've been putting off this refactor for a while, but now that the
mikro-orm removal and ffmpeg builder PRs are in, it is time.
* refactor: use ts import paths on server