mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
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:
@@ -6,6 +6,7 @@ import { webhookConnections } from "@/lib/db/schema";
|
||||
import { createLogger } from "@/lib/logger";
|
||||
import type { WebhookEvent } from "@/lib/services/webhooks";
|
||||
import {
|
||||
parseEmbyPayload,
|
||||
parseJellyfinPayload,
|
||||
parsePlexPayload,
|
||||
processWebhook,
|
||||
@@ -36,6 +37,9 @@ export async function POST(
|
||||
if (connection.provider === "plex") {
|
||||
const formData = await req.formData();
|
||||
event = parsePlexPayload(formData);
|
||||
} else if (connection.provider === "emby") {
|
||||
const body = await req.json();
|
||||
event = parseEmbyPayload(body);
|
||||
} else {
|
||||
const body = await req.json();
|
||||
event = parseJellyfinPayload(body);
|
||||
|
||||
Reference in New Issue
Block a user