- Sidebar: show Podcasts section only when podcast libraries exist; show hint text when no libraries are configured yet - Admin: extract LibraryForm component, add edit (Pencil) button per library with inline form and PATCH support - Backend: add media_type to LibraryUpdate schema and PATCH handler - FileBrowser: add quick-access shortcuts (/audiofiles /data /media /), show all files+dirs so users can confirm correct folder Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
25 lines
931 B
TypeScript
25 lines
931 B
TypeScript
import api from './client'
|
|
|
|
export const getLibraries = () =>
|
|
api.get('/api/libraries').then((r) => r.data.libraries)
|
|
|
|
export const getLibraryItems = (
|
|
libraryId: string,
|
|
params?: { page?: number; limit?: number; search?: string; sort?: string }
|
|
) => api.get(`/api/libraries/${libraryId}/items`, { params }).then((r) => r.data)
|
|
|
|
export const searchLibrary = (libraryId: string, q: string) =>
|
|
api.get(`/api/libraries/${libraryId}/search`, { params: { q } }).then((r) => r.data)
|
|
|
|
export const scanLibrary = (libraryId: string) =>
|
|
api.post(`/api/libraries/${libraryId}/scan`).then((r) => r.data)
|
|
|
|
export const createLibrary = (data: object) =>
|
|
api.post('/api/libraries', data).then((r) => r.data)
|
|
|
|
export const updateLibrary = (id: string, data: object) =>
|
|
api.patch(`/api/libraries/${id}`, data).then((r) => r.data)
|
|
|
|
export const deleteLibrary = (id: string) =>
|
|
api.delete(`/api/libraries/${id}`).then((r) => r.data)
|