From fffe0bf55df061558e3ee11e1aab9b490d563678 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Thu, 24 Sep 2026 21:25:00 +0000 Subject: [PATCH] update envs --- .../transforms/spotify/SpotifyTransformerUtil.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/backend/common/transforms/spotify/SpotifyTransformerUtil.ts b/src/backend/common/transforms/spotify/SpotifyTransformerUtil.ts index 099c6bef..0831447b 100644 --- a/src/backend/common/transforms/spotify/SpotifyTransformerUtil.ts +++ b/src/backend/common/transforms/spotify/SpotifyTransformerUtil.ts @@ -5,6 +5,7 @@ import type { import type { SpotifyTransformerApiConfigData } from "../../vendor/spotify/SpotifyTypes.ts"; import { MaybeLogger } from "../../MaybeLogger.ts"; import * as z from 'zod'; +import { removeUndefinedKeys } from "../../../../core/DataUtils.ts"; export const spotifyMissingTypes = z.enum(['album','title','artists','duration','isrc','ids']); export type SpotifyMissingType = z.infer; @@ -63,7 +64,11 @@ export const configFromEnv = (logger: MaybeLogger = new MaybeLogger()): SpotifyT return undefined; } - const deprioritizeCompilations = (process.env.SPOTIFY_TRANSFORM_DEPRIORITIZE_COMPILATIONS ?? '').trim().toLocaleLowerCase() === 'true'; + const defaults = { + market: process.env.SPOTIFY_TRANSFORM_MARKET, + locale: process.env.SPOTIFY_TRANSFORM_LOCALE, + deprioritizeCompilations: process.env.SPOTIFY_TRANSFORM_DEPRIORITIZE_COMPILATIONS !== undefined ? process.env.SPOTIFY_TRANSFORM_DEPRIORITIZE_COMPILATIONS.trim().toLocaleLowerCase() === 'true' : undefined + } return { type: 'spotify', @@ -71,11 +76,7 @@ export const configFromEnv = (logger: MaybeLogger = new MaybeLogger()): SpotifyT data: { clientId, clientSecret, - market: process.env.SPOTIFY_TRANSFORM_MARKET, - locale: process.env.SPOTIFY_TRANSFORM_LOCALE }, - defaults: { - ...(deprioritizeCompilations ? { deprioritizeCompilations } : {}) - } + defaults: removeUndefinedKeys(defaults, false) }; } -- 2.51.2