From 9692995c75b4c55f3f343802c0f26cc5f6b56f1f Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 16 Sep 2023 17:52:24 +0300 Subject: [PATCH 1/3] Update storage.ts --- scripts/core/storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/core/storage.ts b/scripts/core/storage.ts index e1831a6254..128ae3ba4f 100644 --- a/scripts/core/storage.ts +++ b/scripts/core/storage.ts @@ -7,7 +7,7 @@ export class Storage { rootDir: string constructor(rootDir?: string) { - this.rootDir = rootDir || './' + this.rootDir = path.normalize(rootDir || './') } list(pattern: string): Promise { From 99dad2f66d000bf9e0d81aeaf2e4bc4a50d5dc48 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 16 Sep 2023 17:52:27 +0300 Subject: [PATCH 2/3] Update file.ts --- scripts/core/file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/core/file.ts b/scripts/core/file.ts index f12e8ba6d3..54c88fe64b 100644 --- a/scripts/core/file.ts +++ b/scripts/core/file.ts @@ -5,7 +5,7 @@ export class File { content: string constructor(filepath: string, content?: string) { - this.filepath = filepath + this.filepath = path.normalize(filepath) this.content = content || '' } From 29106c77cb3adb46beb477f5958a3bd57b038cfb Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Sat, 16 Sep 2023 17:52:39 +0300 Subject: [PATCH 3/3] Update validate.ts --- scripts/commands/playlist/validate.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/commands/playlist/validate.ts b/scripts/commands/playlist/validate.ts index 03bb782f8e..8c6f020e3a 100644 --- a/scripts/commands/playlist/validate.ts +++ b/scripts/commands/playlist/validate.ts @@ -5,6 +5,7 @@ import chalk from 'chalk' import { transliterate } from 'transliteration' import _ from 'lodash' import { DATA_DIR, STREAMS_DIR } from '../../constants' +import path from 'path' program.argument('[filepath]', 'Path to file to validate').parse(process.argv) @@ -40,7 +41,7 @@ async function main() { const log = new Collection() const buffer = new Dictionary() try { - const relativeFilepath = filepath.replace(STREAMS_DIR, '') + const relativeFilepath = filepath.replace(path.normalize(STREAMS_DIR), '') const playlist = await parser.parse(relativeFilepath) playlist.streams.forEach((stream: Stream) => { const channelNotInDatabase =