]> zdv2.bktei.com Git - BK-2020-03.git/blobdiff - user/bkmpv2
feat(user/bkots):Add time delay between calls to calendar server
[BK-2020-03.git] / user / bkmpv2
index 36453db8c73e012bc94dce48990b5018b917b1b2..7e51cc11b2faf205a0de63ace7c5869c3c7227be 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env bash
 # Desc: Wrapper for mpv that accepts directory or file paths via posargs or stdin lines
 # Usage: bkmpv2 [DIR]
 #!/usr/bin/env bash
 # Desc: Wrapper for mpv that accepts directory or file paths via posargs or stdin lines
 # Usage: bkmpv2 [DIR]
-# Version: 0.2.1
+# Version: 0.2.2
 # Depends: GNU Parallel, GNU Bash v5.1.16, mpv v0.34.1, bc v1.07.1
 # Ref/Attrib: [1] Tange, Ole. GNU Parallel with Bash Array. 2019-03-24. https://unix.stackexchange.com/a/508365/411854
 # Example: find $HOME/Music -type d | bkmpv2
 # Depends: GNU Parallel, GNU Bash v5.1.16, mpv v0.34.1, bc v1.07.1
 # Ref/Attrib: [1] Tange, Ole. GNU Parallel with Bash Array. 2019-03-24. https://unix.stackexchange.com/a/508365/411854
 # Example: find $HOME/Music -type d | bkmpv2
@@ -10,8 +10,8 @@
 # Note: Does not follow symlinks
 
 # Find settings
 # Note: Does not follow symlinks
 
 # Find settings
-firegex=".+\(aac\|aif\|aiff\|flac\|m4a\|mp3\|mp4\|ogg\|opus\|wav\)$"; # POSIX regex for find. Update according to `find . -type f | grep -Eo "\.([[:alnum:]])+$" | sort -u`
-file_regex=".+(aac|aif|aiff|flac|m4a|mp3|mp4|ogg|opus|wav)$"; # extended regex for Bash.
+firegex=".+\(aac\|aif\|aiff\|flac\|m4a\|mp3\|mp4\|ogg\|opus\|wav\|webm\)$"; # POSIX regex for find. Update according to `find . -type f | grep -Eo "\.([[:alnum:]])+$" | sort -u`
+file_regex=".+(aac|aif|aiff|flac|m4a|mp3|mp4|ogg|opus|wav|webm)$"; # extended regex for Bash.
 fsize="10k"; # default: minimum "10k"
 fdepth_posarg="10"; # find depth for positional arguments
 fdepth_stdin="1";  # find depth for stdin
 fsize="10k"; # default: minimum "10k"
 fdepth_posarg="10"; # find depth for positional arguments
 fdepth_stdin="1";  # find depth for stdin
@@ -301,12 +301,14 @@ main() {
         # Check if dir and not dotfile
         if [[ -d "$line" ]] && [[ ! "$line_bn" =~ $re_dotfile ]]; then
             dirs_stdin+=("$line");
         # Check if dir and not dotfile
         if [[ -d "$line" ]] && [[ ! "$line_bn" =~ $re_dotfile ]]; then
             dirs_stdin+=("$line");
+            yell "DEBUG:Is a dir:${line}"; # debug
             continue;
         fi;
 
         # Check if file
         if [[ -f "$line" ]]; then
             files_stdin+=("$line");
             continue;
         fi;
 
         # Check if file
         if [[ -f "$line" ]]; then
             files_stdin+=("$line");
+            yell "DEBUG:Is a file:${line}"; # debug
             continue;
         fi;
 
             continue;
         fi;
 
@@ -316,7 +318,9 @@ main() {
     yell "STATUS:$SECONDS:Read stdin and psargs.";
 
     # Apply the $file_regex to $files_stdin array
     yell "STATUS:$SECONDS:Read stdin and psargs.";
 
     # Apply the $file_regex to $files_stdin array
+    declare -p files_stdin;
     check_files;
     check_files;
+    declare -p files_stdin;
 
     # Catch all arrays empty
     if [[ "${#dirs_stdin[@]}" -le 0 ]] && \
 
     # Catch all arrays empty
     if [[ "${#dirs_stdin[@]}" -le 0 ]] && \