diff --git a/watch/watch.sh b/watch/watch.sh index 9b7b645..f895c46 100755 --- a/watch/watch.sh +++ b/watch/watch.sh @@ -35,6 +35,7 @@ fi find_series | while read -r series; do if [ "$1" = "$series" ]; then cd "$src_path/$series" + # use absolute or relative linking if [ -z "$link_path" ]; then src_path="" current="${series}_current" @@ -43,10 +44,12 @@ find_series | while read -r series; do current="${link_path}/${series}_current" fi + # create first symlink if series was never watched before if [ ! -f "$current" ]; then ln -s "$src_path$(find . -maxdepth 1 -printf "%f\\n" | tail -n+2 | sort | head -n1)" "$current" fi + echo "Playing: $(readlink "$current")" mpv --input-conf "${conf_path}/input.conf" "$current" && ln -sf "$src_path$(next)" "$current" fi done