about summary refs log tree commit diff stats
path: root/hm/soispha/pkgs/scripts/wrappers
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-03 22:42:04 +0100
committerSoispha <soispha@vhack.eu>2024-01-03 22:42:04 +0100
commitea09ccf2e9b48b3aa870e90095a44fc8839ba9ff (patch)
tree6e9321f643940e7a687fd5472d308e1d31c7f1af /hm/soispha/pkgs/scripts/wrappers
parentfeat(hm/pkgs/scr): Add support for python based scripts (diff)
downloadnixos-config-ea09ccf2e9b48b3aa870e90095a44fc8839ba9ff.zip
feat(hm/pkgs/scr/ytcc): Add support for showing comments
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/ytc (renamed from hm/soispha/pkgs/scripts/wrappers/ytc)8
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/yts (renamed from hm/soispha/pkgs/scripts/wrappers/yts)0
2 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"
 
diff --git a/hm/soispha/pkgs/scripts/wrappers/yts b/hm/soispha/pkgs/scripts/specific/ytcc/yts
index b5edf52c..b5edf52c 100755
--- a/hm/soispha/pkgs/scripts/wrappers/yts
+++ b/hm/soispha/pkgs/scripts/specific/ytcc/yts