mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Added nml loading
This commit is contained in:
1 parent
3ace90179b
commit
cc254e9a9b
10 files changed
+400
-59
No files matched your search
@@ -101,6 +101,26 @@ export interface EditState {
|
||||
nml_path: string
|
||||
}
|
||||
|
||||
export interface CollectionStatus {
|
||||
loaded: boolean
|
||||
path: string | null
|
||||
tracks: number | null
|
||||
playlists: number | null
|
||||
}
|
||||
|
||||
export interface FsEntry {
|
||||
name: string
|
||||
path: string
|
||||
}
|
||||
|
||||
export interface FsListing {
|
||||
path: string
|
||||
parent: string | null
|
||||
home: string
|
||||
dirs: FsEntry[]
|
||||
files: FsEntry[]
|
||||
}
|
||||
|
||||
export interface SaveResult {
|
||||
saved: boolean
|
||||
backup: string | null
|
||||
@@ -142,6 +162,13 @@ function qs(params: Record<string, unknown>): string {
|
||||
}
|
||||
|
||||
export const api = {
|
||||
// ---- collection selection ----
|
||||
collection: () => getJSON<CollectionStatus>('/api/collection'),
|
||||
openCollection: (path: string) =>
|
||||
send<CollectionStatus>('POST', '/api/collection/open', { path }),
|
||||
listDir: (path?: string) =>
|
||||
getJSON<FsListing>(`/api/fs/list${path ? `?path=${encodeURIComponent(path)}` : ''}`),
|
||||
|
||||
stats: () => getJSON<Stats>('/api/stats'),
|
||||
facets: () => getJSON<Facets>('/api/facets'),
|
||||
playlists: () => getJSON<PlaylistNode[]>('/api/playlists'),
|
||||
|
||||
Reference in new issue
Block a user