mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-02 07:01:53 +01:00
20 lines
421 B
TypeScript
20 lines
421 B
TypeScript
import { Api } from "@jellyfin/sdk";
|
|
import { getMediaInfoApi } from "@jellyfin/sdk/lib/utils/api";
|
|
|
|
export const getPlaybackInfo = async (
|
|
api?: Api | null | undefined,
|
|
itemId?: string | null | undefined,
|
|
userId?: string | null | undefined,
|
|
) => {
|
|
if (!api || !itemId || !userId) {
|
|
return null;
|
|
}
|
|
|
|
const a = await getMediaInfoApi(api).getPlaybackInfo({
|
|
itemId,
|
|
userId,
|
|
});
|
|
|
|
return a.data;
|
|
};
|