From 63073c30f879fbdb20056bb7c9436f46c6d424de Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 31 Aug 2020 18:26:46 -0400 Subject: Change media_result response in no media case Change the response from the media_result verb when there is no media present to a success with an empty media array instead of a failure. Bug-AGL: SPEC-3556 Signed-off-by: Scott Murray Change-Id: Iafa99d32062db197430a5daf99aee7e2ec0a9a5e --- README.md | 2 ++ binding/media-manager.c | 15 +++++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b4fada9..fbd3769 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ with the following fields. | genre | genre type for media entry | | type | media entry data type *(e.g audio, video)* | +If no media is present, the an empty array will be returned. + ## Events | Name | Description | diff --git a/binding/media-manager.c b/binding/media-manager.c index 8e1ac69..310f581 100644 --- a/binding/media-manager.c +++ b/binding/media-manager.c @@ -393,7 +393,7 @@ gint media_lists_get(MediaDevice_t* mdev, gchar **error) MediaList_t *mlist = NULL; ScanFilter_t *filters = NULL; gint ret = -1; - gint scaned_media = 0; + gint scanned_media = 0; gint i = 0; if(!mdev) @@ -418,16 +418,11 @@ gint media_lists_get(MediaDevice_t* mdev, gchar **error) free(mdev->lists[i]); mdev->lists[i] = NULL; } else { - scaned_media += ret; + scanned_media += ret; } } } - if(scaned_media == 0) - { - *error = g_strdup("No media found!"); - return -1; - } - LOGD("\n\tscanned media: %d\n",scaned_media); - return scaned_media; -} \ No newline at end of file + LOGD("\n\tscanned media: %d\n",scanned_media); + return scanned_media; +} -- cgit 1.2.3-korg