Skip to content

Commit

Permalink
Fixed Fatal Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryental authored and Cryental committed Sep 22, 2020
1 parent 64cb1cb commit c03b6ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 4 additions & 3 deletions SRTSubtitleConverter/ProcessingHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions SRTSubtitleConverter/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"profiles": {
"SRTSubtitleConverter": {
"commandName": "Project"
}
}
"profiles": {
"SRTSubtitleConverter": {
"commandName": "Project"
}
}
}
1 change: 0 additions & 1 deletion SRTSubtitleConverter/SRTSubtitleConverter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<Copyright>Developed By @Cryental, GPLv3.0</Copyright>
<Description>This tool can quickly convert subtitles format from one format to SubRip (SRT) format.</Description>
<RuntimeIdentifiers>win-x64;osx.10.15-x64;ubuntu.20.04-x64</RuntimeIdentifiers>
<PublishTrimmed>true</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishSingleFile>true</PublishSingleFile>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand Down

0 comments on commit c03b6ca

Please sign in to comment.