about summary refs log tree commit diff stats
path: root/hm/soispha/pkgs/scripts/specific/ytcc/ytc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/ytc (renamed from hm/soispha/pkgs/scripts/wrappers/ytc)8
1 files changed, 8 insertions, 0 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/ytc b/hm/soispha/pkgs/scripts/specific/ytcc/ytc
index c607ea81..c66ae96c 100755
--- a/hm/soispha/pkgs/scripts/wrappers/ytc
+++ b/hm/soispha/pkgs/scripts/specific/ytcc/ytc
@@ -4,6 +4,8 @@
 SHELL_LIBRARY_VERSION="1.10.2" . %SHELL_LIBRARY_PATH
 CONCURRENT=4
 OUTPUT_PATH="/tmp/ytcc";
+STATUS_FILE="$XDG_RUNTIME_DIR/ytcc/running";
+STATUS_PATH="$(dirname "$STATUS_FILE")";
 
 col() {
     echo "$1" | csvtool -t ';' -u ';' col "$2" -
@@ -11,6 +13,11 @@ col() {
 
 play() {
     msg2 "Playing: '$1'"
+
+    info_json="$(echo "$1" | sed 's|\(.*\)\.[a-z0-9]\+|\1.info.json|')";
+    [ -L "$STATUS_FILE" ] && rm "$STATUS_FILE"
+    ln -s "$(readlink -f "$info_json")" "$STATUS_FILE"
+
     mpv "$1" --speed=2.7 --volume=75
     output="$?";
 
@@ -41,6 +48,7 @@ cat << EOF > "$yt_flags"
 --sponsorblock-remove sponsor
 EOF
 
+[ -d "$STATUS_PATH" ] || mkdir "$STATUS_PATH";
 [ -d "$OUTPUT_PATH" ] || mkdir "$OUTPUT_PATH";
 cd  "$OUTPUT_PATH" || die "(Bug): Was created"