mirror of
https://github.com/Jellify-Music/App.git
synced 2026-01-06 02:50:30 -06:00
* 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>
21 lines
540 B
TypeScript
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)
|
|
})
|
|
})
|
|
}
|