From c3d43245f69639183766b10a530963129fa8d867 Mon Sep 17 00:00:00 2001 From: Stephane Desneux Date: Wed, 1 Aug 2018 12:07:54 +0200 Subject: 4a-api: add subcommands for mediaplayer and mediascanner Change-Id: Ib4933d68efe23c9f1dce0b190db713bc2001d057 Signed-off-by: Stephane Desneux --- bin/4a-api | 8 +++++++- bin/lib4a-tools.sh | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/4a-api b/bin/4a-api index 1e1bb39..694397f 100755 --- a/bin/4a-api +++ b/bin/4a-api @@ -13,7 +13,10 @@ function usage() { log " api [args]: send direct request to API verb with args" log " roles: get AHL roles" log " hals [-a|--all] [-v|--verbose]: get HALs status" + log " mediascanner ... : interact with mediascanner service" + log " example: 4a-api mediascanner media_result \"\"" log " mediaplayer ... : interact with mediaplayer service" + log " example: 4a-api mediaplayer playlist \"\"" log " radio ... : interact with radio service" exit 1 } @@ -38,8 +41,11 @@ case $cmd in done 4a-client 4a-hal-manager loaded "{'verbose':$verbose,'all':$all}" ;; + mediascanner) + mediascanner-client "$@" + ;; mediaplayer) - echo "TODO" + mediaplayer-client "$@" ;; radio) echo "TODO" diff --git a/bin/lib4a-tools.sh b/bin/lib4a-tools.sh index 776b1c0..f799cc2 100644 --- a/bin/lib4a-tools.sh +++ b/bin/lib4a-tools.sh @@ -45,3 +45,10 @@ function 4a-client() { function 4a-roles() { 4a-client ahl-4a get_roles "" | tail -n +2 | jq '.response|.[]' } + +function mediascanner-client() { + afb-client-demo -H -d unix:/run/user/0/apis/ws/mediascanner "$@" +} +function mediaplayer-client() { + afb-client-demo -H -d unix:/run/user/0/apis/ws/mediaplayer "$@" +} -- cgit 1.2.3-korg