mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-25 19:13:54 +00:00
Fix uncovered type errors
This commit is contained in:
parent
c88d8b390e
commit
cb2254bdb7
2 changed files with 5 additions and 6 deletions
|
|
@ -10,11 +10,10 @@ export default function enableMediaSession(webamp: WebampLazy) {
|
|||
const {
|
||||
metaData: { title, artist, album, albumArtUrl },
|
||||
} = track;
|
||||
// @ts-ignore TypeScript does not know about the Media Session API: https://github.com/Microsoft/TypeScript/issues/19473
|
||||
navigator.mediaSession.metadata = new MediaMetadata({
|
||||
title,
|
||||
artist,
|
||||
album,
|
||||
title: title ?? undefined,
|
||||
artist: artist ?? undefined,
|
||||
album: album ?? undefined,
|
||||
artwork: albumArtUrl
|
||||
? [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ const formatHz = (hz: number): string =>
|
|||
hz < 1000 ? `${hz}HZ` : `${hz / 1000}KHZ`;
|
||||
|
||||
// Format a number as a string, ensuring it has a + or - sign
|
||||
const ensureSign = (num: number | string): string =>
|
||||
const ensureSign = (num: number): string =>
|
||||
num > 0 ? `+${num}` : num.toString();
|
||||
|
||||
// Round to 1 and exactly 1 decimal point
|
||||
|
|
@ -41,5 +41,5 @@ const roundToTenths = (num: number): string =>
|
|||
export const getEqText = (band: Slider, level: number): string => {
|
||||
const db = roundToTenths(((level - 50) / 50) * 12);
|
||||
const label = band === "preamp" ? "Preamp" : formatHz(band);
|
||||
return `EQ: ${label} ${ensureSign(db)} DB`;
|
||||
return `EQ: ${label} ${ensureSign(Number(db))} DB`;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue