Skip to content

Commit

Permalink
Discard the playerctl stderr when listing players
Browse files Browse the repository at this point in the history
This fixes a test failure when using glib 2.73.3.

playerctl with glib 2.73.3 emits a deprecation warning and that is
merged into the player list and the comparison with 'mpv' then fails.

When mpv is not present, the reason for that still needs to be printed,
so re-run the command when it failed or did not detect mpv is the player.
  • Loading branch information
pabs3 authored and hoyon committed Sep 10, 2022
1 parent 8974cb7 commit 6ab69f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/setup
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ wait_for () {
}

playerctl_list_all_is_mpv () {
player="$(playerctl --list-all 2>&1)"
test "$player" = mpv
ret=0 ; player="$(playerctl --list-all 2> /dev/null)" || ret=$?
if [ $ret -ne 0 ] || [ "$player" != mpv ] ; then
playerctl --list-all ; return $((ret?ret:1))
fi
}

status () {
Expand Down

0 comments on commit 6ab69f9

Please sign in to comment.