Files
App/api/queries/functions/media.ts
Ritesh Shukla ff7c454011 Initial Setup for Toggle (#280)
* Initial Setup for Toggle

* Enhancements to Offline (#279)

* [skip actions]

* xcode and project stuff

* Enhancements to Offline (#279)

* fix workflows

* we don't need tests running on a pr, it's already going to run on a push

* complete move to yarn

* run formatter

* fix build, prep for using mediasources

* linting errors

---------

Co-authored-by: Ritesh Shukla <ritesh.shukla2@M-LD4JMWLW26.local>
Co-authored-by: Violet Caulfield <42452695+anultravioletaurora@users.noreply.github.com>
Co-authored-by: anultravioletaurora <jellify@cosmonautical.com>
Co-authored-by: Violet Caulfield <violet@cosmonautical.cloud>
2025-04-24 07:23:01 -05:00

21 lines
540 B
TypeScript

import { PlaybackInfoResponse } from '@jellyfin/sdk/lib/generated-client/models'
import Client from '../../../api/client'
import { getMediaInfoApi } from '@jellyfin/sdk/lib/utils/api'
export async function fetchMediaInfo(itemId: string): Promise<PlaybackInfoResponse> {
return new Promise((resolve, reject) => {
getMediaInfoApi(Client.api!)
.getPlaybackInfo({
itemId,
userId: Client.user?.id,
})
.then(({ data }) => {
console.debug(data)
resolve(data)
})
.catch((error) => {
reject(error)
})
})
}