From c03b6cae1cafac71732fd585a6d0a5b6f1fba858 Mon Sep 17 00:00:00 2001 From: Cryental Date: Tue, 22 Sep 2020 17:30:22 +0600 Subject: [PATCH] Fixed Fatal Bugs --- SRTSubtitleConverter/ProcessingHandler.cs | 7 ++++--- SRTSubtitleConverter/Properties/launchSettings.json | 10 +++++----- SRTSubtitleConverter/SRTSubtitleConverter.csproj | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/SRTSubtitleConverter/ProcessingHandler.cs b/SRTSubtitleConverter/ProcessingHandler.cs index d684d9f..d65ffe4 100644 --- a/SRTSubtitleConverter/ProcessingHandler.cs +++ b/SRTSubtitleConverter/ProcessingHandler.cs @@ -30,7 +30,7 @@ public bool ConvertToSRT(string inputPath, string outputPath, bool folderFlag = if (folderFlag) { - outputFilePath = Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(inputPath)}.srt"); + outputFilePath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(inputPath) + ".srt"); } foreach (var sf in _supportedFormats) @@ -52,13 +52,14 @@ public bool ConvertToSRT(string inputPath, string outputPath, bool folderFlag = } } + if (string.IsNullOrEmpty(finalResult)) { return false; } File.WriteAllText(outputFilePath, finalResult, Encoding.UTF8); - Console.WriteLine($"[-] {Path.GetFileName(inputPath)}"); + Console.WriteLine($"[+] Converted File: {Path.GetFileName(inputPath)}"); Console.WriteLine("[*] The operation is completed."); return true; } @@ -72,7 +73,7 @@ public bool ConvertBathToSRT(string inputPath, string outputPath) foreach (var f in files.GetFiles()) { - var outputFilePath = Path.Combine(outputPath, $"{Path.GetFileNameWithoutExtension(inputPath)}.srt"); + var outputFilePath = Path.Combine(outputPath, Path.GetFileNameWithoutExtension(f.Name) + ".srt"); var finalResult = string.Empty; foreach (var sf in _supportedFormats) diff --git a/SRTSubtitleConverter/Properties/launchSettings.json b/SRTSubtitleConverter/Properties/launchSettings.json index 03850c8..a9e40d2 100644 --- a/SRTSubtitleConverter/Properties/launchSettings.json +++ b/SRTSubtitleConverter/Properties/launchSettings.json @@ -1,7 +1,7 @@ { - "profiles": { - "SRTSubtitleConverter": { - "commandName": "Project" - } - } + "profiles": { + "SRTSubtitleConverter": { + "commandName": "Project" + } + } } \ No newline at end of file diff --git a/SRTSubtitleConverter/SRTSubtitleConverter.csproj b/SRTSubtitleConverter/SRTSubtitleConverter.csproj index d9bddd8..b939300 100644 --- a/SRTSubtitleConverter/SRTSubtitleConverter.csproj +++ b/SRTSubtitleConverter/SRTSubtitleConverter.csproj @@ -11,7 +11,6 @@ Developed By @Cryental, GPLv3.0 This tool can quickly convert subtitles format from one format to SubRip (SRT) format. win-x64;osx.10.15-x64;ubuntu.20.04-x64 - true true true win-x64