diff options
author | B. Stack <bgstack15@gmail.com> | 2024-05-15 16:55:36 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-05-15 16:55:36 -0400 |
commit | 1f68cfa0086b1b0ef9e30f31c15bb64a52cd264d (patch) | |
tree | a4ccafff39acfe4483cbf238c72fa77b2edbc05a | |
parent | add show-manager and its autocomplete (diff) | |
download | jellystack-master.tar.gz jellystack-master.tar.bz2 jellystack-master.zip |
-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() { |