diff --git a/CHANGELOG.md b/CHANGELOG.md index 409b96c..ea445de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Migrated to [Slash Commands](https://support.discord.com/hc/en-us/articles/1500000368501-Slash-Commands-FAQ) - The queue embed now automatically updates every 5 seconds (and has buttons for quick interactions) +## [0.5.4] - 2022-02-01 +### Fixed +- Prisma no longer causes a crash when running on Windows + +## [0.5.3] - 2022-02-01 +### Changed +- Environment variable values are now trimmed (whitespace is removed) + ## [0.5.2] - 2022-01-29 ### Fixed - Playing livestreams now works again @@ -57,7 +65,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release -[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.2...HEAD +[Unreleased]: https://github.com/codetheweb/muse/compare/v0.5.4...HEAD +[0.5.4]: https://github.com/codetheweb/muse/compare/v0.5.3...v0.5.4 +[0.5.3]: https://github.com/codetheweb/muse/compare/v0.5.2...v0.5.3 [0.5.2]: https://github.com/codetheweb/muse/compare/v0.5.1...v0.5.2 [0.5.1]: https://github.com/codetheweb/muse/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/codetheweb/muse/compare/v0.4.0...v0.5.0 diff --git a/package.json b/package.json index cfe54d4..8b45124 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "muse", - "version": "0.5.2", + "version": "0.5.4", "description": "🎧 a self-hosted Discord music bot that doesn't suck ", "exports": "./dist/src/index.js", "repository": "git@github.com:codetheweb/muse.git", diff --git a/src/services/config.ts b/src/services/config.ts index 82cffee..cd56915 100644 --- a/src/services/config.ts +++ b/src/services/config.ts @@ -40,7 +40,7 @@ export default class Config { if (typeof value === 'number') { this[key as ConditionalKeys] = value; } else if (typeof value === 'string') { - this[key as ConditionalKeys] = value; + this[key as ConditionalKeys] = value.trim(); } else if (typeof value === 'boolean') { this[key as ConditionalKeys] = value; } else { diff --git a/src/utils/create-database-url.ts b/src/utils/create-database-url.ts index becc973..d17789b 100644 --- a/src/utils/create-database-url.ts +++ b/src/utils/create-database-url.ts @@ -2,6 +2,14 @@ import {join} from 'path'; export const createDatabasePath = (directory: string) => join(directory, 'db.sqlite'); -const createDatabaseUrl = (directory: string) => `file:${createDatabasePath(directory)}`; +const createDatabaseUrl = (directory: string) => { + const url = `file:${createDatabasePath(directory)}`; + + if (process.platform === 'win32') { + return url.replaceAll(/\\/g, '\\\\'); + } + + return url; +}; export default createDatabaseUrl;