From f7fcb87d280e17d1567bea85d0caeaff6cef9c89 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 e1831a625..128ae3ba4 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 fe7e768829d0bfb8a4b785f5833e9bebe3c73fc5 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 f12e8ba6d..54c88fe64 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 71b6fdb278e23f9977160072941024bd90bb8c4c 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 03bb782f8..8c6f020e3 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 =