small cleanup
Mwebclient/src/components/FileBrowser.tsx
@@ -11,7 +11,7 @@ import {
Suspense,
} from "solid-js";
import { type MediaFile, type FileListing, fileSort } from "music-server-shared/types";
import { getItemName, type AppOptions, type PlaylistItem } from "../types";
import type { AppOptions, PlaylistItem } from "../types";
import { generateUUID, joinPath, LocalStorageValues, toast } from "../utils";
import { ClosedFolderSVG, MusicSVG, RefreshSVG } from "./SVG";
import { clearCoverCache as deleteCover, clearDirectoryCache, getCover, listFiles } from "../offline";
Mwebclient/src/types.ts
@@ -7,7 +7,7 @@ export interface PlaylistItem extends MediaFile {
export function getItemName(item: Pick<PlaylistItem, "path">): string;
export function getItemName(item: Pick<PlaylistItem, "path"> | null): string | undefined;
export function getItemName(item?: Pick<PlaylistItem, "path"> | null) {
export function getItemName(item: Pick<PlaylistItem, "path"> | null) {
if (!item) return undefined;
return item.path.split("/").toReversed()[0];
}