From c94b93fb92675a89b2edb0aa0f020e5403b43d03 Mon Sep 17 00:00:00 2001 From: absidue <48293849+absidue@users.noreply.github.com> Date: Mon, 26 Dec 2022 10:57:37 +0100 Subject: [PATCH] Use path.sep instead of working out the directory separator ourselves --- src/renderer/components/ft-video-player/ft-video-player.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ft-video-player/ft-video-player.js b/src/renderer/components/ft-video-player/ft-video-player.js index fcbef9a98d701..a120861c8e8fc 100644 --- a/src/renderer/components/ft-video-player/ft-video-player.js +++ b/src/renderer/components/ft-video-player/ft-video-player.js @@ -1390,10 +1390,9 @@ export default Vue.extend({ return } - const dirChar = process.platform === 'win32' ? '\\' : '/' let subDir = '' - if (filename.indexOf(dirChar) !== -1) { - const lastIndex = filename.lastIndexOf(dirChar) + if (filename.indexOf(path.sep) !== -1) { + const lastIndex = filename.lastIndexOf(path.sep) subDir = filename.substring(0, lastIndex) filename = filename.substring(lastIndex + 1) }