aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-08-31 18:26:46 -0400
committerScott Murray <scott.murray@konsulko.com>2020-08-31 18:28:39 -0400
commit63073c30f879fbdb20056bb7c9436f46c6d424de (patch)
treec9d239b2bc669396372bc762a04370c34e17d6a6
parent05bbefa54c7e15b916c2f73c9b0495bdde9c488b (diff)
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 <scott.murray@konsulko.com> Change-Id: Iafa99d32062db197430a5daf99aee7e2ec0a9a5e
-rw-r--r--README.md2
-rw-r--r--binding/media-manager.c15
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;
+}