diff options
Diffstat (limited to '')
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/ytc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/ytc b/hm/soispha/pkgs/scripts/wrappers/ytc index c7797c16..9dfbf6c5 100755 --- a/hm/soispha/pkgs/scripts/wrappers/ytc +++ b/hm/soispha/pkgs/scripts/wrappers/ytc @@ -10,14 +10,14 @@ col() { } play() { - dbg "Playing: $1" + msg2 "Playing: $1" mpv "$1" --speed=2.7 output="$?"; if [ "$output" -eq 0 ]; then - dbg "Removing: $1" + msg2 "Removing: $1" rm "$1" - dbg "Marking: " "$2" + msg2 "Marking: " "$2" ytcc mark "$2" fi return "$output" @@ -51,7 +51,8 @@ while read -r base; do echo "$old_filename,$old_id" >> "$files_to_play" # Check if the process (pid) exists - if ! kill -0 "$pid" >/dev/null; then + dbg "PID is '$pid'" + if ! kill -0 "$pid"; then saved_base="$(head -n 1 "$files_to_play")"; sed -i '1d' "$files_to_play"; saved_name="$(col "$saved_base" 1)"; @@ -59,7 +60,7 @@ while read -r base; do dbg "Started play for '$saved_name'" play "$saved_name" "$saved_id" & - pid="$!" + pid=$! else dbg "Storing for later '$old_filename'" fi |