Feature/move close stream (#176)

* Move stream destroy closer to where stream is retrieved

* Change BNB_SUBSONIC_URL to be of type URLBuilder to better handle URL construction rather than string concat, should addresse #169
This commit is contained in:
Simon J
2023-10-10 11:25:55 +11:00
committed by GitHub
parent b8caf90e06
commit a5689c3d4b
5 changed files with 176 additions and 178 deletions

View File

@@ -58,8 +58,6 @@ const asBoolean = (value: string) => value == "true";
const asInt = (value: string) => Number.parseInt(value);
const asStringNoTrailingSlash = (value: string) => value.replace(/\/$/, "");
export default function () {
const port = bnbEnvVar<number>("PORT", { default: 4534, parser: asInt })!;
const bonobUrl = bnbEnvVar("URL", {
@@ -100,8 +98,7 @@ export default function () {
sid: bnbEnvVar<number>("SONOS_SERVICE_ID", { default: 246, parser: asInt }),
},
subsonic: {
// todo: why isnt this a url like bonobUrl above?
url: bnbEnvVar("SUBSONIC_URL", { legacy: ["BONOB_NAVIDROME_URL"], default: `http://${hostname()}:4533`, parser: asStringNoTrailingSlash })!,
url: url(bnbEnvVar("SUBSONIC_URL", { legacy: ["BONOB_NAVIDROME_URL"], default: `http://${hostname()}:4533` })!),
customClientsFor: bnbEnvVar<string>("SUBSONIC_CUSTOM_CLIENTS", { legacy: ["BONOB_NAVIDROME_CUSTOM_CLIENTS"] }),
artistImageCache: bnbEnvVar<string>("SUBSONIC_ARTIST_IMAGE_CACHE"),
},