mirror of
https://github.com/revenz/FileFlowsPlugins.git
synced 2026-02-24 23:09:13 -06:00
added option to audio track remover to remove after a starting index
This commit is contained in:
@@ -10,17 +10,19 @@ public class FfmpegBuilderAudioTrackRemover: FfmpegBuilderNode
|
||||
|
||||
[Boolean(1)]
|
||||
public bool RemoveAll { get; set; }
|
||||
[NumberInt(2)]
|
||||
public int RemoveIndex { get; set; }
|
||||
|
||||
|
||||
[TextVariable(2)]
|
||||
[TextVariable(3)]
|
||||
[ConditionEquals(nameof(RemoveAll), false)]
|
||||
public string Pattern { get; set; }
|
||||
|
||||
[Boolean(3)]
|
||||
[Boolean(4)]
|
||||
[ConditionEquals(nameof(RemoveAll), false)]
|
||||
public bool NotMatching { get; set; }
|
||||
|
||||
[Boolean(4)]
|
||||
[Boolean(5)]
|
||||
[ConditionEquals(nameof(RemoveAll), false)]
|
||||
public bool UseLanguageCode { get; set; }
|
||||
|
||||
@@ -29,8 +31,17 @@ public class FfmpegBuilderAudioTrackRemover: FfmpegBuilderNode
|
||||
this.Init(args);
|
||||
bool removing = false;
|
||||
Regex? regex = null;
|
||||
int index = -1;
|
||||
foreach(var audio in Model.AudioStreams)
|
||||
{
|
||||
if (audio.Deleted == false)
|
||||
{
|
||||
// only record indexes of tracks that have not been deleted
|
||||
++index;
|
||||
if (index < RemoveIndex)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (RemoveAll)
|
||||
{
|
||||
audio.Deleted = true;
|
||||
|
||||
@@ -253,7 +253,9 @@
|
||||
"NotMatching": "Not Matching",
|
||||
"NotMatching-Help": "If audio tracks NOT matching the pattern should be removed",
|
||||
"UseLanguageCode": "Use Language Code",
|
||||
"UseLanguageCode-Help": "If the language code of the audio track should be used instead of the title"
|
||||
"UseLanguageCode-Help": "If the language code of the audio track should be used instead of the title",
|
||||
"RemoveIndex": "Remove Index",
|
||||
"RemoveIndex-Help": "The start index where to remove the audio tracks from. This allows you to remove all, or all matching, audio streams after the starting index.\nSet to zero to remove all matching the parameters.\nSet to 1 to keep the first audio track and remove any after the first matching the parameters"
|
||||
}
|
||||
},
|
||||
"FfmpegBuilderAudioTrackReorder": {
|
||||
|
||||
Reference in New Issue
Block a user