From 3c58ef1b1c812b4b4f6734385ce62f02671b607d Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Thu, 5 Sep 2024 10:48:06 +0200 Subject: [PATCH 1/8] feat: added flag for mpv as flatpak --- ani-cli | 4 ++++ ani-cli.1 | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ani-cli b/ani-cli index d00427b08..c9c615f84 100755 --- a/ani-cli +++ b/ani-cli @@ -45,6 +45,8 @@ help_info() { Download the video instead of playing it -D, --delete Delete history + -f, --flatpak-mpv + Use mpv (flatpak) to play the video -l, --logview Show logs -s, --syncplay @@ -364,6 +366,8 @@ while [ $# -gt 0 ]; do *) player_function="vlc" ;; esac ;; + -f | --flatpak-mpv) + player_function="flatpak_mpv" ;; -s | --syncplay) case "$(uname -s)" in Darwin*) player_function="/Applications/Syncplay.app/Contents/MacOS/syncplay" ;; diff --git a/ani-cli.1 b/ani-cli.1 index 7c66cc23c..d7e3e8817 100644 --- a/ani-cli.1 +++ b/ani-cli.1 @@ -25,6 +25,9 @@ Continue watching anime from history. \fB\-d | --download\fR Download episode. .TP +\fB\-f | --flatpak-mpv\fR +Wathc anime via mpv packaged as flatpak. +.TP \fB\-D | --delete\fR Delete history. .TP From 0ac825a8b7edd6ce0fd322efcbbaa96cefd7e069 Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Thu, 5 Sep 2024 10:51:55 +0200 Subject: [PATCH 2/8] chore bump version --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index c9c615f84..8368ca782 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.9.0" +version_number="4.9.1" # UI From 012216dfdbbc94cec7a0d99e45a4c5238a1ca599 Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Thu, 5 Sep 2024 10:55:07 +0200 Subject: [PATCH 3/8] chore: appease shfmt --- ani-cli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 8368ca782..6e9deab00 100755 --- a/ani-cli +++ b/ani-cli @@ -367,7 +367,8 @@ while [ $# -gt 0 ]; do esac ;; -f | --flatpak-mpv) - player_function="flatpak_mpv" ;; + player_function="flatpak_mpv" + ;; -s | --syncplay) case "$(uname -s)" in Darwin*) player_function="/Applications/Syncplay.app/Contents/MacOS/syncplay" ;; From 2463fc619665966e8b2228920acca2dd018a0714 Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Mon, 16 Sep 2024 16:06:36 +0200 Subject: [PATCH 4/8] fix: revert flatpak mpv flag fix: auto-detect mpv installation similar to iina --- ani-cli | 22 +++++++++++----------- ani-cli.1 | 3 --- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/ani-cli b/ani-cli index 6e9deab00..8c1b7fc8d 100755 --- a/ani-cli +++ b/ani-cli @@ -45,8 +45,6 @@ help_info() { Download the video instead of playing it -D, --delete Delete history - -f, --flatpak-mpv - Use mpv (flatpak) to play the video -l, --logview Show logs -s, --syncplay @@ -124,6 +122,12 @@ where_iina() { dep_ch iina # exit with formating } +where_mpv() { + command -v "$ANI_CLI_PLAYER" >/dev/null && printf "%s" "$ANI_CLI_PLAYER" && return 0 + command -v "flatpak" >/dev/null && flatpak info io.mpv.Mpv >/dev/null 2>&1 && printf "%s" "flatpak_mpv" && return 0 + dep_ch mpv # exit with formating +} + # SCRAPING # extract the video links from response of embed urls, extract mp4 links form m3u8 lists @@ -337,10 +341,12 @@ quality="${ANI_CLI_QUALITY:-best}" case "$(uname -a)" in *Darwin*) player_function="$(where_iina)" ;; # mac OS *ndroid*) player_function="${ANI_CLI_PLAYER:-android_mpv}" ;; # Android OS (termux) - *neptune*) player_function="${ANI_CLI_PLAYER:-flatpak_mpv}" ;; # steamdeck OS *MINGW* | *WSL2*) player_function="${ANI_CLI_PLAYER:-mpv.exe}" ;; # Windows OS *ish*) player_function="${ANI_CLI_PLAYER:-iSH}" ;; # iOS (iSH) - *) player_function="${ANI_CLI_PLAYER:-mpv}" ;; # Linux OS + *) + player_function="${ANI_CLI_PLAYER:-$(where_mpv)}" # Linux OS + [ $? -eq 0 ] || exit $? + ;; esac no_detach="${ANI_CLI_NO_DETACH:-0}" @@ -366,9 +372,6 @@ while [ $# -gt 0 ]; do *) player_function="vlc" ;; esac ;; - -f | --flatpak-mpv) - player_function="flatpak_mpv" - ;; -s | --syncplay) case "$(uname -s)" in Darwin*) player_function="/Applications/Syncplay.app/Contents/MacOS/syncplay" ;; @@ -436,13 +439,10 @@ if [ -z "$ANI_CLI_NON_INTERACTIVE" ]; then dep_ch fzf || true; fi case "$player_function" in debug) ;; download) dep_ch "ffmpeg" "aria2c" ;; - flatpak*) - dep_ch "flatpak" - flatpak info io.mpv.Mpv >/dev/null 2>&1 || die "Program \"mpv (flatpak)\" not found. Please install it." - ;; android*) printf "\33[2K\rChecking of players on Android is disabled\n" ;; *iSH*) printf "\33[2K\rChecking of players on iOS is disabled\n" ;; *iina*) true ;; # handled out of band in where_iina + *mpv*) true ;; # handled out of band in where_mpv *) dep_ch "$player_function" ;; esac diff --git a/ani-cli.1 b/ani-cli.1 index d7e3e8817..7c66cc23c 100644 --- a/ani-cli.1 +++ b/ani-cli.1 @@ -25,9 +25,6 @@ Continue watching anime from history. \fB\-d | --download\fR Download episode. .TP -\fB\-f | --flatpak-mpv\fR -Wathc anime via mpv packaged as flatpak. -.TP \fB\-D | --delete\fR Delete history. .TP From 9dcf25ef26108fefdeea177f62d68faee8d27660 Mon Sep 17 00:00:00 2001 From: Derisis13 Date: Mon, 16 Sep 2024 18:14:11 +0200 Subject: [PATCH 5/8] fix: check_iina posix compliance chore: indent --- ani-cli | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ani-cli b/ani-cli index 8c1b7fc8d..18da3f674 100755 --- a/ani-cli +++ b/ani-cli @@ -339,14 +339,17 @@ download_dir="${ANI_CLI_DOWNLOAD_DIR:-.}" log_episode="${ANI_CLI_LOG:-1}" quality="${ANI_CLI_QUALITY:-best}" case "$(uname -a)" in - *Darwin*) player_function="$(where_iina)" ;; # mac OS + *Darwin*) # mac OS + player_function="$(where_iina)" + [ $? -eq 0 ] || exit $? + ;; *ndroid*) player_function="${ANI_CLI_PLAYER:-android_mpv}" ;; # Android OS (termux) *MINGW* | *WSL2*) player_function="${ANI_CLI_PLAYER:-mpv.exe}" ;; # Windows OS *ish*) player_function="${ANI_CLI_PLAYER:-iSH}" ;; # iOS (iSH) - *) - player_function="${ANI_CLI_PLAYER:-$(where_mpv)}" # Linux OS - [ $? -eq 0 ] || exit $? - ;; + *) # Linux OS + player_function="${ANI_CLI_PLAYER:-$(where_mpv)}" + [ $? -eq 0 ] || exit $? + ;; esac no_detach="${ANI_CLI_NO_DETACH:-0}" From 2577a143c51f3811cf671f6d05a308a5ca53b820 Mon Sep 17 00:00:00 2001 From: port19 Date: Mon, 16 Sep 2024 18:20:48 +0200 Subject: [PATCH 6/8] bump `actions/checkout` --- .github/workflows/ani-cli.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ani-cli.yml b/.github/workflows/ani-cli.yml index 884fc4376..8ec2b9c04 100644 --- a/.github/workflows/ani-cli.yml +++ b/.github/workflows/ani-cli.yml @@ -12,7 +12,7 @@ jobs: name: Shellcheck + Shfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run the sh-checker uses: luizm/action-sh-checker@master env: @@ -23,7 +23,7 @@ jobs: name: Executable Bit runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: test exec bit run: test -x "./ani-cli" @@ -31,6 +31,6 @@ jobs: name: No Awk Allowed runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: verify that noone added awk run: '! grep awk "./ani-cli"' From 553c106e43574ceffb328ee11c38e0fa693e2faa Mon Sep 17 00:00:00 2001 From: port19 Date: Mon, 16 Sep 2024 18:21:19 +0200 Subject: [PATCH 7/8] bump `actions/checkout` --- .github/workflows/markdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown.yml b/.github/workflows/markdown.yml index 0dacb020b..6bc210753 100644 --- a/.github/workflows/markdown.yml +++ b/.github/workflows/markdown.yml @@ -22,5 +22,5 @@ jobs: name: Find Trailing Whitespace runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ocular-d/trailing-spaces@0.0.2 From 71de8f76c2b0372701c7f74f69733de20febb028 Mon Sep 17 00:00:00 2001 From: port19 Date: Mon, 16 Sep 2024 18:21:40 +0200 Subject: [PATCH 8/8] bump `actions/checkout` --- .github/workflows/version.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index d8ce20d21..0dce9c044 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -9,7 +9,7 @@ jobs: name: Version Bump runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: check version bump