From dd21521c214816d5b462a34b1e861549e3dcc361 Mon Sep 17 00:00:00 2001 From: OmrSi Date: Mon, 6 Dec 2021 16:06:32 +0200 Subject: [PATCH] Set empty wave path for online videos in Waveforms folder --- src/libse/Common/WaveToVisualizer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libse/Common/WaveToVisualizer.cs b/src/libse/Common/WaveToVisualizer.cs index cc25ff12b..a3d3c3900 100644 --- a/src/libse/Common/WaveToVisualizer.cs +++ b/src/libse/Common/WaveToVisualizer.cs @@ -347,13 +347,14 @@ namespace Nikse.SubtitleEdit.Core.Common public static string GetPeakWaveFileName(string videoFileName, int trackNumber = 0) { + var dir = Configuration.WaveformsDirectory.TrimEnd(Path.DirectorySeparatorChar); + if (videoFileName != null && (videoFileName.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || videoFileName.StartsWith("https://", StringComparison.OrdinalIgnoreCase))) { - return MovieHasher.GenerateHashFromString(videoFileName); + return Path.Combine(dir, $"{MovieHasher.GenerateHashFromString(videoFileName)}.wav"); } - var dir = Configuration.WaveformsDirectory.TrimEnd(Path.DirectorySeparatorChar); if (!Directory.Exists(dir)) { Directory.CreateDirectory(dir);