Skip to content

Commit 97d0d81

Browse files
committed
Release 2.14.0
1 parent 3313e4c commit 97d0d81

File tree

4 files changed

+21
-21
lines changed

4 files changed

+21
-21
lines changed

.github/workflows/BuildImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
echo "MULTI_ARCH=${{ env.MULTI_ARCH }}" >> $GITHUB_OUTPUT
3232
if [[ -z "${{ env.MOD_VERSION }}" ]]; then
3333
# **** If the mod needs to be versioned, set the versioning logic below. Otherwise leave as is. ****
34-
MOD_VERSION="2.13.3"
34+
MOD_VERSION="2.14.0"
3535
else
3636
MOD_VERSION=${{ env.MOD_VERSION }}
3737
echo "MOD_VERSION_OVERRIDE=true" >> $GITHUB_OUTPUT

README.md

Lines changed: 2 additions & 2 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.
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

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Only the latest major and minor version are supported.
66

77
| Version | Supported |
88
| ------- | ------------------ |
9-
| 2.13.x | :heavy_check_mark: |
10-
| < 2.13 | :x: |
9+
| 2.14.x | :heavy_check_mark: |
10+
| < 2.14 | :x: |
1111

1212
## Reporting a Vulnerability
1313

root/usr/local/bin/striptracks.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ mode.
7676
Source: https://github.com/TheCaptain989/radarr-striptracks
7777
7878
Usage:
79-
$0 [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [--reorder] [{-f|--file} <video_file>]] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]
79+
$0 [{-a|--audio} <audio_languages> [{-s|--subs} <subtitle_languages>] [{-f|--file} <video_file>]] [--reorder] [{-l|--log} <log_file>] [{-c|--config} <config_file>] [{-d|--debug} [<level>]]
8080
8181
Options can also be set via the STRIPTRACKS_ARGS environment variable.
8282
Command-line arguments override the environment variable.
@@ -92,14 +92,14 @@ Options and Arguments:
9292
multiple codes may be concatenated.
9393
Each code may optionally be followed by a
9494
plus \`+\` and one or more modifiers.
95-
--reorder Reorder audio and subtitles tracks to match
96-
the language code order specified in the
97-
<audio_languages> and <subtitle_languages>
98-
arguments.
9995
-f, --file <video_file> If included, the script enters batch mode
10096
and converts the specified video file.
10197
WARNING: Do not use this argument when called
10298
from Radarr or Sonarr!
99+
--reorder Reorder audio and subtitles tracks to match
100+
the language code order specified in the
101+
<audio_languages> and <subtitle_languages>
102+
arguments.
103103
-l, --log <log_file> Log filename
104104
[default: /config/log/striptracks.txt]
105105
-c, --config <config_file> Radarr/Sonarr XML configuration file
@@ -659,8 +659,8 @@ function delete_video {
659659
# }
660660
# Update file metadata in Radarr/Sonarr
661661
function set_metadata {
662-
local url="$striptracks_api_url/$striptracks_videofile_api/editor"
663-
local data="$(echo $striptracks_original_metadata | jq -crM "{${striptracks_videofile_api}Ids: [${striptracks_videofile_id}], quality, releaseGroup}")"
662+
local url="$striptracks_api_url/$striptracks_videofile_api/bulk"
663+
local data="$(echo $striptracks_original_metadata | jq -crM "[{id:${striptracks_videofile_id}, quality, releaseGroup}]")"
664664
local i=0
665665
for ((i=1; i <= 5; i++)); do
666666
[ $striptracks_debug -ge 1 ] && echo "Debug|Updating from quality '$(echo $striptracks_videofile_info | jq -crM .quality.quality.name)' to '$(echo $striptracks_original_metadata | jq -crM .quality.quality.name)' and release group '$(echo $striptracks_videofile_info | jq -crM '.releaseGroup | select(. != null)')' to '$(echo $striptracks_original_metadata | jq -crM '.releaseGroup | select(. != null)')'. Calling ${striptracks_type^} API using PUT and URL '$url' with data $data" | log
@@ -794,10 +794,10 @@ function rename_video {
794794
fi
795795
return $striptracks_return
796796
}
797-
# Set video language in Radarr
798-
function set_radarr_language {
799-
local url="$striptracks_api_url/$striptracks_videofile_api/editor"
800-
local data="{\"${striptracks_videofile_api}Ids\":[${striptracks_videofile_id}],\"languages\":${striptracks_json_languages}}"
797+
# Set video language
798+
function set_language {
799+
local url="$striptracks_api_url/$striptracks_videofile_api/bulk"
800+
local data="[{\"id\":${striptracks_videofile_id},\"languages\":${striptracks_json_languages}}]"
801801
[ $striptracks_debug -ge 1 ] && echo "Debug|Updating from language(s) '$(echo $striptracks_videofile_info | jq -crM "[.languages[].name] | join(\",\")")' to '$(echo $striptracks_json_languages | jq -crM "[.[].name] | join(\",\")")'. Calling ${striptracks_type^} API using PUT and URL '$url' with data $data" | log
802802
unset striptracks_result
803803
striptracks_result=$(curl -s --fail-with-body -H "X-Api-Key: $striptracks_apikey" \
@@ -818,8 +818,8 @@ function set_radarr_language {
818818
fi
819819
return $striptracks_return
820820
}
821-
# Set video language in Sonarr
822-
function set_sonarr_language {
821+
# Set video language in Sonarr v3
822+
function set_legacy_sonarr_language {
823823
local url="$striptracks_api_url/$striptracks_videofile_api/editor"
824824
local data="{\"${striptracks_videofile_api}Ids\":[${striptracks_videofile_id}],\"language\":$(echo $striptracks_json_languages | jq -crM ".[0]")}"
825825
[ $striptracks_debug -ge 1 ] && echo "Debug|Updating from language '$(echo $striptracks_videofile_info | jq -crM ".language.name")' to '$(echo $striptracks_json_languages | jq -crM ".[0].name")'. Calling ${striptracks_type^} API using PUT and URL '$url' with data $data" | log
@@ -1539,7 +1539,7 @@ if [ "$(echo "$striptracks_json_processed" | jq -crM '.tracks|map(select(.type==
15391539
fi
15401540

15411541
# Map current track order
1542-
striptracks_order=$(echo "$striptracks_json_processed" | jq -jcM '.tracks | map(.id | "0:" + tostring) | join(",")')
1542+
striptracks_order=$(echo "$striptracks_json_processed" | jq -jcM '.tracks | map(select(.striptracks_keep) | .id | "0:" + tostring) | join(",")')
15431543
[ $striptracks_debug -ge 1 ] && echo "Debug|Current mkvmerge track order: $striptracks_order" | log
15441544

15451545
# Prepare to reorder tracks if option is enabled (see issue #92)
@@ -1848,7 +1848,7 @@ elif [ -n "$striptracks_api_url" ]; then
18481848
# Sooooo glad I did it this way
18491849
if [ "$(echo $striptracks_videofile_info | jq -crM .languages)" != "null" ]; then
18501850
if [ "$(echo $striptracks_videofile_info | jq -crM .languages)" != "$striptracks_json_languages" ]; then
1851-
if set_radarr_language; then
1851+
if set_language; then
18521852
striptracks_exitstatus=0
18531853
else
18541854
striptracks_message="Error|${striptracks_type^} error when updating video language(s)."
@@ -1863,7 +1863,7 @@ elif [ -n "$striptracks_api_url" ]; then
18631863
# Check languages for Sonarr v3 and earlier
18641864
elif [ "$(echo $striptracks_videofile_info | jq -crM .language)" != "null" ]; then
18651865
if [ "$(echo $striptracks_videofile_info | jq -crM .language)" != "$(echo $striptracks_json_languages | jq -crM '.[0]')" ]; then
1866-
if set_sonarr_language; then
1866+
if set_legacy_sonarr_language; then
18671867
striptracks_exitstatus=0
18681868
else
18691869
striptracks_message="Error|${striptracks_type^} error when updating video language(s)."

0 commit comments

Comments
 (0)