Skip to content

Commit a121bf5

Browse files
authored
Merge pull request #1027 from TheCaptain989/radarr-striptracks
radarr: striptracks release 2.13.3
2 parents 4074324 + f4c387e commit a121bf5

File tree

4 files changed

+112
-51
lines changed

4 files changed

+112
-51
lines changed

.github/workflows/BuildImage.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
name: Build Image
22

3-
on: [push, pull_request_target, workflow_dispatch]
3+
on:
4+
push:
5+
pull_request_target:
6+
workflow_dispatch:
7+
inputs:
8+
mod_version:
9+
type: string
10+
required: false
411

512
env:
613
GITHUB_REPO: "linuxserver/docker-mods" #don't modify
714
ENDPOINT: "linuxserver/mods" #don't modify
815
BASEIMAGE: "radarr" #replace
916
MODNAME: "striptracks" #replace
17+
MOD_VERSION: ${{ inputs.mod_version }} #don't modify
1018
MULTI_ARCH: "false" #set to true if needed
1119

1220
jobs:
@@ -21,8 +29,13 @@ jobs:
2129
echo "BASEIMAGE=${{ env.BASEIMAGE }}" >> $GITHUB_OUTPUT
2230
echo "MODNAME=${{ env.MODNAME }}" >> $GITHUB_OUTPUT
2331
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
24-
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
25-
MOD_VERSION="2.13.0"
32+
if [[ -z "${{ env.MOD_VERSION }}" ]]; then
33+
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
34+
MOD_VERSION="2.13.3"
35+
else
36+
MOD_VERSION=${{ env.MOD_VERSION }}
37+
echo "MOD_VERSION_OVERRIDE=true" >> $GITHUB_OUTPUT
38+
fi
2639
echo "MOD_VERSION=${MOD_VERSION}" >> $GITHUB_OUTPUT
2740
outputs:
2841
GITHUB_REPO: ${{ steps.outputs.outputs.GITHUB_REPO }}
@@ -31,6 +44,7 @@ jobs:
3144
MODNAME: ${{ steps.outputs.outputs.MODNAME }}
3245
MULTI_ARCH: ${{ steps.outputs.outputs.MULTI_ARCH }}
3346
MOD_VERSION: ${{ steps.outputs.outputs.MOD_VERSION }}
47+
MOD_VERSION_OVERRIDE: ${{ steps.outputs.outputs.MOD_VERSION_OVERRIDE }}
3448

3549
build:
3650
uses: linuxserver/github-workflows/.github/workflows/docker-mod-builder.yml@v1
@@ -47,3 +61,4 @@ jobs:
4761
MODNAME: ${{ needs.set-vars.outputs.MODNAME }}
4862
MULTI_ARCH: ${{ needs.set-vars.outputs.MULTI_ARCH }}
4963
MOD_VERSION: ${{ needs.set-vars.outputs.MOD_VERSION }}
64+
MOD_VERSION_OVERRIDE: ${{ needs.set-vars.outputs.MOD_VERSION_OVERRIDE }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
## Buildstage ##
4-
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 as buildstage
4+
FROM ghcr.io/linuxserver/baseimage-alpine:3.20 AS buildstage
55
ARG MOD_VERSION
66

77
# copy local files

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ All language conditions with positive scores *and* Negated conditions with negat
210210
The script also supports command-line arguments that will override the automatic language detection. More granular control can therefore be exerted or extended using tagging and defining multiple *Connect* scripts (this is native Radarr/Sonarr functionality outside the scope of this documentation).
211211

212212
The syntax for the command-line is:
213-
`striptracks.sh [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [--reorder] [{-f|--file} <video_file>]] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]`
213+
`striptracks.sh [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [{-f|--file} <video_file>]] [--reorder] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]`
214214

215215
<details>
216216
<summary>Table of Command-Line Arguments</summary>
@@ -219,8 +219,8 @@ Option|Argument|Description
219219
---|---|---
220220
`-a`, `--audio`|`<audio_languages>`|Audio languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more [modifiers](#language-code-modifiers).
221221
`-s`, `--subs`|`<subtitle_languages>`|Subtitle languages to keep<br/>ISO 639-2 code(s) prefixed with a colon (`:`)<br/>Each code may optionally be followed by a plus (`+`) and one or more modifiers.
222-
`--reorder`| |Reorder audio and subtitles tracks to match the language code order specified in the `<audio_languages>` and `<subtitle_languages>` arguments.<br/>This is skipped if no tracks are removed.
223222
`-f`, `--file`|`<video_file>`|If included, the script enters **[Batch Mode](#batch-mode)** and converts the specified video file.<br/>Requires the `--audio` option.<br/>![notes] **Do not** use this argument when called from Radarr or Sonarr!
223+
`--reorder`| |Reorder audio and subtitles tracks to match the language code order specified in the `<audio_languages>` and `<subtitle_languages>` arguments.
224224
`-l`, `--log`|`<log_file>`|The log filename<br/>Default is `/config/log/striptracks.txt`
225225
`-c`, `--config`|`<config_file>`|Radarr/Sonarr XML configuration file<br/>Default is `/config/config.xml`
226226
`-d`, `--debug`|`[<level>]`|Enables debug logging. Level is optional.<br/>Default is `1` (low)<br/>`2` includes JSON output<br/>`3` contains even more JSON output
@@ -238,7 +238,7 @@ For example:
238238

239239
...etc.
240240

241-
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant, unless the `--reorder` option is also specified.
241+
Multiple codes may be concatenated, such as `:eng:spa` for both English and Spanish. Order is unimportant, unless the `--reorder` option is specified.
242242

243243
> [!WARNING]
244244
> If no subtitle language is detected via Radarr/Sonarr configuration or specified on the command-line, all subtitles are removed.
@@ -280,6 +280,37 @@ The `:und` language code is a special code. When used, the script will match on
280280
> [!TIP]
281281
> It is common for M2TS and AVI files to have tracks with unknown languages! It is recommended to include `:und` in most instances unless you know exactly what you're doing.
282282

283+
### Reorder Option
284+
The `--reorder` option uses the order the language codes are specified to re-order the tracks in the output MKV video file. Video tracks are always first, followed by audio tracks, and then subtitles. Track removals and preservations occur the way they normally would.
285+
286+
<details>
287+
<summary>Reorder Example</summary>
288+
289+
For example, given a source video (w/original language of English) that has the following track order:
290+
291+
> Track ID:0 Type:video Name:null Lang:und Codec:AVC/H.264/MPEG-4p10 Default:true Forced:false
292+
> Track ID:1 Type:audio Name:French Lang:fre Codec:E-AC-3 Default:true Forced:false
293+
> Track ID:2 Type:audio Name:German Lang:deu Codec:AC-3 Default:false Forced:false
294+
> Track ID:3 Type:audio Name:English Lang:eng Codec:AC-3 Default:false Forced:false
295+
> Track ID:4 Type:subtitles Name:French Lang:fre Codec:SubRip/SRT Default:false Forced:false
296+
> Track ID:5 Type:subtitles Name:English Lang:eng Codec:SubRip/SRT Default:false Forced:false
297+
298+
And using the command line:
299+
300+
```shell
301+
/usr/local/bin/striptracks.sh --audio :org+1:eng+1:fre+1:und+1 --subs :eng+1:fre+1:spa+1 --reorder
302+
```
303+
304+
Will create an MKV file with tracks:
305+
306+
> Track ID:0 Type:video Name:null Lang:und Codec:AVC/H.264/MPEG-4p10 Default:true Forced:false
307+
> Track ID:1 Type:audio Name:English Lang:eng Codec:AC-3 Default:false Forced:false
308+
> Track ID:2 Type:audio Name:French Lang:fre Codec:E-AC-3 Default:true Forced:false
309+
> Track ID:3 Type:subtitles Name:English Lang:eng Codec:SubRip/SRT Default:false Forced:false
310+
> Track ID:4 Type:subtitles Name:French Lang:fre Codec:SubRip/SRT Default:false Forced:false
311+
312+
</details>
313+
283314
## Special Handling of Audio
284315
The script is smart enough to not remove the last audio track. There is in fact no way to force the script to remove all audio. This way you don't have to specify every possible language if you are importing a foreign film, for example.
285316

0 commit comments

Comments
 (0)