Skip to content

Commit

Permalink
add locale check
Browse files Browse the repository at this point in the history
  • Loading branch information
Arial-Z committed Dec 21, 2023
1 parent 2d589f7 commit 5a524eb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion animes-renamer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

export LC_ALL=C.UTF-8
SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
media_type="animes"
source "$SCRIPT_FOLDER/config/.env"
Expand Down
1 change: 0 additions & 1 deletion movies-renamer.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash

export LC_ALL=C.UTF-8
SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
echo "$SCRIPT_FOLDER"
media_type="movies"
Expand Down
9 changes: 8 additions & 1 deletion plex-romaji-renamer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
RUN_ANIMES_SCRIPT=0
RUN_MOVIES_SCRIPT=0
RUN_SEASONAL_SCRIPT=0
export LC_ALL=C.UTF-8
locale=$(locale -a | grep -w "utf8" | head -n 1)
if [ -z "$locale" ]
then
printf "%s - Error no utf8 locale installed\n" "$(date +%H:%M:%S)" | tee -a "$LOG"
exit 1
else
export LC_ALL="$locale"
fi
SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
LOG=$LOG_FOLDER/${media_type}_$(date +%Y.%m.%d).log
if [ ! -d "$SCRIPT_FOLDER/config" ]
Expand Down
1 change: 0 additions & 1 deletion seasonal-animes-download.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

# SCRIPT VARIABLES
export LC_ALL=C.UTF-8
SCRIPT_FOLDER=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
media_type=seasonal
source "$SCRIPT_FOLDER/config/.env"
Expand Down

0 comments on commit 5a524eb

Please sign in to comment.