From 984b7d3f4291e9f8db9570992a47c5bc725da6f9 Mon Sep 17 00:00:00 2001 From: home Date: Sat, 30 Dec 2023 22:17:44 +0300 Subject: [PATCH] Name : Make name_series auto-determine season number. --- .config/bash/module/Name.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.config/bash/module/Name.sh b/.config/bash/module/Name.sh index 3b6cfa8..3372fef 100644 --- a/.config/bash/module/Name.sh +++ b/.config/bash/module/Name.sh @@ -135,17 +135,17 @@ function name_hash_check() { # Rename files for Jellyfin series, i.e. `Episode S01E01.mkv` # All files by default. -# Usage: name_series [FILES] +# Usage: name_series [FILES] function name_series() { local IFS=$'\n' - local season=${1} + local season="$(realpath .)"; season="${season##*\ }" local episode=0 - local targets=(${@:2}) + local targets=(${@}) [[ "${targets}" = "" ]] && targets=($(_ls_file)) # Error when no season number specified. if [[ "${season}" = "" ]]; then - echo "usage: name_series [FILES]" + _error "Could not determine season number." return 2 fi @@ -178,7 +178,7 @@ function name_manga() { # Error when no season number specified. if [[ "${season}" = "" ]]; then - echo "usage: name_manga [FILES]" + help name_manga return 2 fi