Add Emby webhook integration and remove unused username field

Add Emby as a third media server integration alongside Plex and Jellyfin.
Emby webhooks use a similar payload format (JSON with nested Item object
and ProviderIds). Also removes the mediaServerUsername field from all
webhook connections since it was never used for authentication — the
token-in-URL is the sole auth mechanism. This simplifies the connection
UX to a single "Connect" button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 00:50:32 -05:00
co-authored by Claude Opus 4.6
parent 0409a65a56
commit bafa45ec79
11 changed files with 2292 additions and 178 deletions
+4 -4
View File
@@ -15,7 +15,7 @@ export function setTitleStatus(
titleId: string,
status: "watchlist" | "in_progress" | "completed",
// biome-ignore lint/correctness/noUnusedFunctionParameters: kept for API consistency with callers
source: "manual" | "import" | "plex" | "jellyfin" = "manual",
source: "manual" | "import" | "plex" | "jellyfin" | "emby" = "manual",
) {
const now = new Date();
db.insert(userTitleStatus)
@@ -41,7 +41,7 @@ export function removeTitleStatus(userId: string, titleId: string) {
export function logMovieWatch(
userId: string,
titleId: string,
source: "manual" | "import" | "plex" | "jellyfin" = "manual",
source: "manual" | "import" | "plex" | "jellyfin" | "emby" = "manual",
) {
const now = new Date();
db.insert(userMovieWatches)
@@ -70,7 +70,7 @@ export function logMovieWatch(
export function logEpisodeWatch(
userId: string,
episodeId: string,
source: "manual" | "import" | "plex" | "jellyfin" = "manual",
source: "manual" | "import" | "plex" | "jellyfin" | "emby" = "manual",
) {
const now = new Date();
db.insert(userEpisodeWatches)
@@ -111,7 +111,7 @@ export function logEpisodeWatch(
export function markAllEpisodesWatched(
userId: string,
titleId: string,
source: "manual" | "import" | "plex" | "jellyfin" = "manual",
source: "manual" | "import" | "plex" | "jellyfin" | "emby" = "manual",
) {
const title = db.select().from(titles).where(eq(titles.id, titleId)).get();
if (!title || title.type !== "tv") return;