Skip to content

Commit

Permalink
BatchGuy updated to support remuxing 4K sources. Fixed broken links i…
Browse files Browse the repository at this point in the history
…n the Apps section under Help. (#1)
  • Loading branch information
yaboy58 authored Nov 27, 2020
1 parent 68bf878 commit e1e7459
Show file tree
Hide file tree
Showing 27 changed files with 223 additions and 116 deletions.
2 changes: 1 addition & 1 deletion publish/ilmerge.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SET version="v7.0"
SET version="v7.1"

"..\src\packages\ilmerge.2.14.1208\tools\ILMerge.exe" "..\src\BatchGuy.App\bin\Release\BatchGuy.App.exe" "..\src\packages\System.Linq.Dynamic.1.0.4\lib\net40\System.Linq.Dynamic.dll" "..\src\packages\log4net.2.0.4\lib\net45-full\log4net.dll" "..\src\packages\Newtonsoft.Json.7.0.1\\lib\net45\Newtonsoft.Json.dll" /out:"BatchGuy-%version%.exe" /target:winexe /targetplatform:v4 /ndebug
93 changes: 47 additions & 46 deletions src/BatchGuy.App/CreateEAC3ToBatchForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected string PadNumberWithZeros(int batchCount, int number)
return HelperFunctions.PadNumberWithZeros(batchCount, number);
}
public abstract string GetChapterName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
public abstract string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
public abstract string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension);
public abstract string GetAudioName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleAudio audio, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
public abstract string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration, BluRayTitleSubtitle subtitle, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
public abstract string GetLogName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName);
Expand Down
3 changes: 2 additions & 1 deletion src/BatchGuy.App/Eac3To/Services/EAC3ToOutputService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ public string GetChapterStreamPart()
public string GetVideoStreamPart()
{
StringBuilder sb = new StringBuilder();
string extension = HelperFunctions.GetVideoExtension(_bluRaySummaryInfo.BluRayTitleInfo.Video.Text);
if (_bluRaySummaryInfo.BluRayTitleInfo.Video != null)
{
if (_bluRaySummaryInfo.BluRayTitleInfo.Video.IsSelected)
{
sb.Append(string.Format("{0} ", _bluRaySummaryInfo.BluRayTitleInfo.Video.Id));
sb.Append(_eac3ToOutputNamingService.GetVideoName(_eac3ToConfiguration, _filesOutputPath, _paddedEpisodeNumber, _bluRaySummaryInfo.BluRayTitleInfo.EpisodeName));
sb.Append(_eac3ToOutputNamingService.GetVideoName(_eac3ToConfiguration, _filesOutputPath, _paddedEpisodeNumber, _bluRaySummaryInfo.BluRayTitleInfo.EpisodeName, extension));
}
}
return sb.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration,
return sb.ToString();
}

public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension)
{
StringBuilder sb = new StringBuilder();
if (eac3toConfiguration.IsExtractForRemux != true)
{
if (eac3toConfiguration.IsVideoNameForEncodeMkvMerge == false)
sb.Append(string.Format("\"{0}\\video{1}.mkv\"", filesOutputPath, paddedEpisodeNumber));
sb.Append(string.Format("\"{0}\\video{1}.{2}\"", filesOutputPath, paddedEpisodeNumber, extension));
else
sb.Append(string.Format("\"{0}\"", episodeName));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration,
return sb.ToString();
}

public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension)
{
if (_currentMovieRemuxTemplate == null)
throw new NullReferenceException("Current Movie Template is Null.");
Expand All @@ -126,7 +126,7 @@ public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, str
this.GetFormattedVideoFormat(eac3toConfiguration),
this.GetFormattedAuditoType(eac3toConfiguration));

sb.Append(string.Format("\"{0}\\{1}{2}.mkv\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, _currentMovieRemuxTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), tag));
sb.Append(string.Format("\"{0}\\{1}{2}.{3}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, _currentMovieRemuxTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), tag, extension));
}
return sb.ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration,
return sb.ToString();
}

public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension)
{
StringBuilder sb = new StringBuilder();
if (eac3toConfiguration.IsExtractForRemux == true)
Expand All @@ -126,7 +126,7 @@ public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, str
this.GetFormattedVideoFormat(eac3toConfiguration),
this.GetFormattedAuditoType(eac3toConfiguration));

sb.Append(string.Format("\"{0}\\{1}{2}.mkv\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), tag));
sb.Append(string.Format("\"{0}\\{1}{2}.{3}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), tag, extension));
}
return sb.ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration,
return sb.ToString();
}

public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension)
{
StringBuilder sb = new StringBuilder();
if (eac3toConfiguration.IsExtractForRemux == true)
{
string videoName = string.Format("{0}, {1}E{2}{3}", eac3toConfiguration.RemuxFileNameTemplate.SeriesName, this.GetFormattedSeasonNumber(eac3toConfiguration),
this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedYear(eac3toConfiguration));

sb.Append(string.Format("\"{0}\\{1}.mkv\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces())));
sb.Append(string.Format("\"{0}\\{1}.{2}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), extension));
}
return sb.ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public override string GetSubtitleName(EAC3ToConfiguration eac3toConfiguration,
return sb.ToString();
}

public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName)
public override string GetVideoName(EAC3ToConfiguration eac3toConfiguration, string filesOutputPath, string paddedEpisodeNumber, string episodeName, string extension)
{
StringBuilder sb = new StringBuilder();
if (eac3toConfiguration.IsExtractForRemux == true)
{
string videoName = string.Format("{0}{1}{2}", this.GetFormattedSeasonNumber(eac3toConfiguration),
this.GetFormattedPaddedEpisodeNumber(paddedEpisodeNumber), this.GetFormattedEpisodeName(episodeName));

sb.Append(string.Format("\"{0}\\{1}.mkv\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces())));
sb.Append(string.Format("\"{0}\\{1}.{2}\"", filesOutputPath, this.AddWordSeparator(eac3toConfiguration.IsExtractForRemux, eac3toConfiguration.RemuxFileNameTemplate.UsePeriodsInFileName, videoName.Trim().RemoveDoubleSpaces()), extension));
}
return sb.ToString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ public string GetFFMSIndexPathPart()
public string GetVideoStreamPart()
{
StringBuilder sb = new StringBuilder();
string extension = HelperFunctions.GetVideoExtension(_bluRaySummaryInfo.BluRayTitleInfo.Video.Text);
if (_bluRaySummaryInfo.BluRayTitleInfo.Video != null)
{
if (_bluRaySummaryInfo.BluRayTitleInfo.Video.IsSelected)
{
sb.Append(_eac3ToOutputNamingService.GetVideoName(_eac3ToConfiguration, _filesOutputPath, _paddedEpisodeNumber, _bluRaySummaryInfo.BluRayTitleInfo.EpisodeName));
sb.Append(_eac3ToOutputNamingService.GetVideoName(_eac3ToConfiguration, _filesOutputPath, _paddedEpisodeNumber, _bluRaySummaryInfo.BluRayTitleInfo.EpisodeName, extension));
}
}
return sb.ToString();
Expand Down
16 changes: 15 additions & 1 deletion src/BatchGuy.App/Helpers/HelperFunctions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace BatchGuy.App.Helpers
using System.Linq;

namespace BatchGuy.App.Helpers
{
public static class HelperFunctions
{
Expand All @@ -24,5 +26,17 @@ public static string PadNumberWithZeros(int batchCount, int number)
}
return paddedNumber;
}

public static string GetVideoExtension(string text)
{
string[] values = new string[] { "hevc", "h265", "2160" };

bool isHevc = values.Any(v => text.ToLower().Contains(v));

if (string.IsNullOrEmpty(text) || isHevc == false)
return "mkv";
else
return "h265";
}
}
}
Loading

0 comments on commit e1e7459

Please sign in to comment.