A music player that connects to your cloud/distributed storage.
at v4 20 lines 515 B view raw
1import { SubsonicAPI } from "subsonic-api"; 2 3export class SubsonicAPIWithoutFetch extends SubsonicAPI { 4 /** 5 * @param {import("./types.d.ts").SubsonicConfig} config 6 */ 7 constructor(config) { 8 super({ 9 ...config, 10 fetch: async (path, params) => { 11 if (path.toString().includes("/rest/stream.view")) { 12 return await fetch(path, { ...params, method: "HEAD" }); 13 } else { 14 return await fetch(path, params); 15 } 16 }, 17 }); 18 this.config = config; 19 } 20}