mirror of
https://github.com/austinried/subtracks.git
synced 2026-02-10 15:02:42 +01:00
sync the rest of the source models
refactor music download/storage to avoid re-download during reset add palylist to test server setup
This commit is contained in:
@@ -10,15 +10,15 @@ export class SubsonicClient {
|
||||
|
||||
async get(
|
||||
method: "download",
|
||||
params?: Record<string, string>,
|
||||
params?: [string, string][],
|
||||
): Promise<{ res: Response; xml: undefined }>;
|
||||
async get(
|
||||
method: string,
|
||||
params?: Record<string, string>,
|
||||
params?: [string, string][],
|
||||
): Promise<{ res: Response; xml: Document }>;
|
||||
async get(
|
||||
method: string,
|
||||
params?: Record<string, string>,
|
||||
params?: [string, string][],
|
||||
): Promise<{ res: Response; xml: Document | undefined }> {
|
||||
const url = new URL(`rest/${method}.view`, this.baseUrl);
|
||||
|
||||
@@ -28,9 +28,9 @@ export class SubsonicClient {
|
||||
url.searchParams.set("c", "subtracks-test-fixture");
|
||||
|
||||
if (params) {
|
||||
Object.entries(params).forEach(([key, value]) =>
|
||||
url.searchParams.append(key, value)
|
||||
);
|
||||
for (const [key, value] of params) {
|
||||
url.searchParams.append(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
const res = await fetch(url);
|
||||
|
||||
Reference in New Issue
Block a user