tangled
alpha
login
or
join now
tokono.ma
/
diffuse
5
fork
atom
A music player that connects to your cloud/distributed storage.
5
fork
atom
overview
issues
4
pulls
pipelines
feat: implement opensubsonic artwork action
Steven Vandevelde
2 days ago
aa100cb7
7f8fe2a6
+11
-2
1 changed file
expand all
collapse all
unified
split
src
components
input
opensubsonic
worker.js
+11
-2
src/components/input/opensubsonic/worker.js
···
32
32
/**
33
33
* @type {Actions['artwork']}
34
34
*/
35
35
-
export async function artwork(_uri) {
36
36
-
return null;
35
35
+
export async function artwork(uri) {
36
36
+
const parsed = parseURI(uri);
37
37
+
if (!parsed?.songId) return null;
38
38
+
39
39
+
const client = createClient(parsed.server);
40
40
+
const response = await client.getCoverArt({ id: parsed.songId }).catch(
41
41
+
() => null,
42
42
+
);
43
43
+
if (!response?.ok) return null;
44
44
+
45
45
+
return new Uint8Array(await response.arrayBuffer());
37
46
}
38
47
39
48
/**