@axium/client 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/Audio.svelte CHANGED
@@ -11,7 +11,6 @@
11
11
  }
12
12
 
13
13
  const { cover: showCover, extraControls, ...rest }: Props = $props();
14
- const { src } = rest;
15
14
 
16
15
  const id = $props.id();
17
16
 
@@ -19,18 +18,20 @@
19
18
  pictureURL = $state<string>(),
20
19
  audioInfo = $state<[string, (string | number | null)?][]>([]);
21
20
 
22
- getMetadata(rest).then(result => {
23
- if (!result) return;
24
- picture = result.picture;
25
- pictureURL = result.pictureURL;
26
- const { common } = result.metadata;
27
- audioInfo = [
28
- ['music', common.title],
29
- ['album', common.album],
30
- ['user-music', common.artist],
31
- ['hashtag', common.track.no],
32
- ['compact-disc', common.disk.no],
33
- ] as const;
21
+ $effect(() => {
22
+ getMetadata(rest).then(result => {
23
+ if (!result) return;
24
+ picture = result.picture;
25
+ pictureURL = result.pictureURL;
26
+ const { common } = result.metadata;
27
+ audioInfo = [
28
+ ['music', common.title],
29
+ ['album', common.album],
30
+ ['user-music', common.artist],
31
+ ['hashtag', common.track.no],
32
+ ['compact-disc', common.disk.no],
33
+ ] as const;
34
+ });
34
35
  });
35
36
 
36
37
  const media = new MediaState();
@@ -48,7 +49,7 @@
48
49
  {/if}
49
50
 
50
51
  <audio
51
- {src}
52
+ src={rest.src}
52
53
  bind:currentTime={media.currentTime}
53
54
  bind:duration={media.duration}
54
55
  bind:volume={media.volume}
package/lib/Video.svelte CHANGED
@@ -9,14 +9,13 @@
9
9
  }
10
10
 
11
11
  const { extraControls, ...rest }: Props = $props();
12
- const { src } = rest;
13
12
 
14
13
  const media = new MediaState();
15
14
  </script>
16
15
 
17
16
  <div class="Video" onkeydown={media.keydown}>
18
17
  <video
19
- {src}
18
+ src={rest.src}
20
19
  bind:this={media.element}
21
20
  bind:currentTime={media.currentTime}
22
21
  bind:duration={media.duration}
@@ -27,7 +27,9 @@ export async function getMetadata(props: MediaProps): Promise<MediaMetadataResul
27
27
 
28
28
  const metadataFileInfo = { size: Number(props.size), mimeType: props.type, url: props.src, path: props.name };
29
29
 
30
- const metadata = await (ArrayBuffer.isView(source) ? parseBuffer(source, metadataFileInfo) : parseWebStream(source, metadataFileInfo));
30
+ const metadata = await (ArrayBuffer.isView(source)
31
+ ? parseBuffer(source, metadataFileInfo)
32
+ : parseWebStream(source, metadataFileInfo, { skipPostHeaders: true }));
31
33
 
32
34
  // `picture.data`'s `source` is actually an `ArrayBufferLike`, we need it to be the more specific `ArrayBuffer`
33
35
  const picture = selectCover(metadata.common.picture) satisfies IPicture | null as MediaMetadataResult['picture'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/client",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
4
4
  "author": "James Prevett <jp@jamespre.dev>",
5
5
  "funding": {
6
6
  "type": "individual",