bun 1.4, small improvement
MContainerfile
@@ -1,4 +1,4 @@
FROM docker.io/oven/bun:1.3.14-alpine AS compile
FROM docker.io/oven/bun:1.4-alpine AS compile
WORKDIR /app
COPY . .
Mwebclient/src/offline.ts
@@ -13,19 +13,10 @@ import type {
} from "music-server-shared/types";
import { audioCodecHasBitrate, encodePath } from "music-server-shared/utils";
import { batch, from, type ResourceActions, untrack } from "solid-js";
import { createStore } from "solid-js/store";
import { createStore, unwrap } from "solid-js/store";
import type { FlatFileListing } from "./App";
import { type AppOptions, type LoadedVideoExtras, type Playlist, StreamingMode } from "./types";
import {
basename,
dirname,
handleForbiddenPath,
handleUnauthorized,
joinPath,
parentPaths,
toast,
unproxy,
} from "./utils";
import { basename, dirname, handleForbiddenPath, handleUnauthorized, joinPath, parentPaths, toast } from "./utils";
interface StoredSubtitle extends SubtitleTrack {
data: Blob;
@@ -502,7 +493,7 @@ export async function loadPlaylists() {
export async function savePlaylist(playlist: Playlist, overwrite: boolean) {
playlist.items = playlist.items.map((item) => {
//some less space in the db by omitting ids
return { path: item.path, metadata: unproxy(item.metadata) };
return { path: item.path, metadata: unwrap(item.metadata) };
});
if (overwrite) {
@@ -663,7 +654,7 @@ async function downloadFile(
const storedFile: StoredFile = {
path,
data: blob,
metadata: unproxy(item.metadata),
metadata: unwrap(item.metadata),
...(videoExtras ? { videoExtras } : {}),
};
await db.files.put(storedFile);
Mwebclient/src/utils.ts
@@ -143,10 +143,6 @@ export function formatBytes(bytes: number): string {
return `${value.toFixed(2)} ${sizes[i]}`;
}
export function unproxy<T>(value: T): T {
return JSON.parse(JSON.stringify(value));
}
export function formatFilename(file: Omit<PlaylistItem, "id">, format: FileDisplay): string {
switch (format) {
case FileDisplay.FILENAME: