mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-01-09 01:19:31 -06:00
fixed issue with add audio track not replacing variables in language field
This commit is contained in:
@@ -148,9 +148,10 @@ public class FfmpegBuilderAudioAddTrack : FfmpegBuilderNode
|
||||
internal AudioStream GetBestAudioTrack(NodeParameters args, IEnumerable<AudioStream> streams)
|
||||
{
|
||||
Regex? rgxLanguage = null;
|
||||
string language = args.ReplaceVariables(this.Language ?? string.Empty, stripMissing: true) ?? string.Empty;
|
||||
try
|
||||
{
|
||||
rgxLanguage = new Regex(this.Language, RegexOptions.IgnoreCase);
|
||||
rgxLanguage = new Regex(language, RegexOptions.IgnoreCase);
|
||||
}
|
||||
catch (Exception) { }
|
||||
#pragma warning disable IL2026 // Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
|
||||
@@ -158,14 +159,14 @@ public class FfmpegBuilderAudioAddTrack : FfmpegBuilderNode
|
||||
#pragma warning restore IL2026 // Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code
|
||||
.OrderBy(x =>
|
||||
{
|
||||
if (Language != string.Empty)
|
||||
if (language != string.Empty)
|
||||
{
|
||||
args.Logger?.ILog("Language: " + x.Language, x);
|
||||
if (string.IsNullOrEmpty(x.Language))
|
||||
return 50; // no language specified
|
||||
if (rgxLanguage != null && rgxLanguage.IsMatch(x.Language))
|
||||
return 0;
|
||||
if (x.Language.ToLower() != Language)
|
||||
if (x.Language.ToLower() != language)
|
||||
return 100; // low priority not the desired language
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user