diff options
-rwxr-xr-x | show-manager.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/show-manager.sh b/show-manager.sh index 4c8c4bf..6b4c07f 100755 --- a/show-manager.sh +++ b/show-manager.sh @@ -7,6 +7,7 @@ # Title: Slowly add new episodes of a completed show to jellyfin # Purpose: Check jellyfin for if the last season of a given show is greater than (x-2)/x episodes, and if so, then add that many new episodes. # History: +# 2024-04-20 display when the destination file already exists # Usage: # . ./jellystack-autocomplete.bash ; manage_show stsnw # Improve: @@ -53,8 +54,13 @@ symlink_file() { #season_num_str="$( \printf '%02d' "${season_num}" )" base="$( basename "${infile}" )" season_num_str="$( \printf '%02d' "$( echo "${base}" | grep -oE '\<s[0-9]+e[0-9]+' | awk -F'e' '{print $1}' | tr -dc '0-9' )" )" - test -n "${VERBOSE}" && echo ln -s "${LINK_PREFIX}/Season ${season_num_str}/${base}" "${LINK_DIR}/Season ${season_num_str}/" - test -n "${APPLY}" && ln -s "${LINK_PREFIX}/Season ${season_num_str}/${base}" "${LINK_DIR}/Season ${season_num_str}/" + if test -e "${LINK_DIR}/Season ${season_num_str}/${base}" ; + then + test -n "${VERBOSE}" && echo "Already exists: ${LINK_DIR}/Season ${season_num_str}/${base}" + else + test -n "${VERBOSE}" && echo ln -s "${LINK_PREFIX}/Season ${season_num_str}/${base}" "${LINK_DIR}/Season ${season_num_str}/" + test -n "${APPLY}" && ln -s "${LINK_PREFIX}/Season ${season_num_str}/${base}" "${LINK_DIR}/Season ${season_num_str}/" + fi } list_sorted_episode_files() { |