mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-30 03:36:37 +08:00
21 lines
1.1 KiB
TypeScript
21 lines
1.1 KiB
TypeScript
import { api } from './client'
|
|
import type { EmbyMount, EmbyMountInput, RemoteEmbyView } from '../types/emby'
|
|
|
|
export const embyAPI = {
|
|
listMounts: () => api.get<EmbyMount[]>('/admin/emby/mounts').then((r) => r.data),
|
|
createMounts: (payload: EmbyMountInput) =>
|
|
api.post<{ ok: boolean; created: number }>('/admin/emby/mounts', payload).then((r) => r.data),
|
|
updateMount: (id: string, payload: { name?: string; proxy_play?: boolean; enabled?: boolean }) =>
|
|
api.put<EmbyMount>(`/admin/emby/mounts/${id}`, payload).then((r) => r.data),
|
|
deleteMount: (id: string) => api.delete(`/admin/emby/mounts/${id}`).then((r) => r.data),
|
|
reorderMounts: (ids: string[]) =>
|
|
api.put<{ ok: boolean }>('/admin/emby/mounts/reorder', { ids }).then((r) => r.data),
|
|
listAccountViews: (accountId: string) =>
|
|
api.get<RemoteEmbyView[]>(`/admin/emby/accounts/${accountId}/views`).then((r) => r.data),
|
|
fullMountAccount: (accountId: string, proxy: boolean) =>
|
|
api
|
|
.post<{ ok: boolean; created: number }>(`/admin/emby/accounts/${accountId}/full-mount`, null, {
|
|
params: { proxy: proxy ? 1 : 0 },
|
|
})
|
|
.then((r) => r.data),
|
|
} |