* feat: #655 implement jellyfin media server * fix: table overflow * feat: pr feedback * refactor: format * refactor: merge existing code * fix: code smells * refactor: format commit
22 lines
445 B
TypeScript
22 lines
445 B
TypeScript
"use server";
|
|
|
|
import { api } from "@homarr/api/server";
|
|
|
|
import type { WidgetProps } from "../definition";
|
|
|
|
export default async function getServerDataAsync({ integrationIds }: WidgetProps<"mediaServer">) {
|
|
if (integrationIds.length === 0) {
|
|
return {
|
|
initialData: [],
|
|
};
|
|
}
|
|
|
|
const currentStreams = await api.widget.mediaServer.getCurrentStreams({
|
|
integrationIds,
|
|
});
|
|
|
|
return {
|
|
initialData: currentStreams,
|
|
};
|
|
}
|