From a5e36dc05dc6ef24c0f5227e4b477b581c4d0a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hora=C8=9Biu=20Mlendea?= Date: Wed, 28 Jun 2023 13:53:46 +0300 Subject: [PATCH] subtitles: Improved subtitle language detection --- plex-video-optimiser.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plex-video-optimiser.sh b/plex-video-optimiser.sh index 776a853..9d38fc5 100755 --- a/plex-video-optimiser.sh +++ b/plex-video-optimiser.sh @@ -115,6 +115,7 @@ function getSubtitleTrackName { -e 's/[Ee]uropean/Europe/g' | \ sed -e 's/^\('"${LANGUAGE_VARIANTS_PATTERN}"'\)\s\s*\(.*\)/\2 (\1)/g' \ -e 's/\(.*\)\s\s*\('"${LANGUAGE_VARIANTS_PATTERN}"'\)$/\1 (\2)/g' | \ + sed -e 's/\[Full\]//g' | \ sed -e 's/^العربية/Arabic/g' \ -e 's/^中文/Chinese/g' \ -e 's/^(廣東話\|[Yy]ue)/Cantonese/g' \ @@ -147,7 +148,9 @@ function getSubtitleTrackName { -e 's/^తెలుగు/Telugu/g' \ -e 's/^ไทย/Thai/g' \ -e 's/^українська/Ukrainian/g' \ - -e 's/^Tiếng Việt/Vietnamese/g' + -e 's/^Tiếng Việt/Vietnamese/g' | \ + sed -e 's/^\s*//g' \ + -e 's/\s*$//g' } function getTrackName {