[libmediaart/api-cleanup: 12/14] extract: Add GError for _NO_TITLE, which is required in some cases
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libmediaart/api-cleanup: 12/14] extract: Add GError for _NO_TITLE, which is required in some cases
- Date: Tue, 25 Feb 2014 18:37:06 +0000 (UTC)
commit 834331e81aa8e07ec5b60f7a30b9c814afdc0744
Author: Martyn Russell <martyn lanedo com>
Date: Tue Feb 25 15:33:26 2014 +0000
extract: Add GError for _NO_TITLE, which is required in some cases
libmediaart/extract.c | 5 ++++-
libmediaart/extract.h | 7 +++----
2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/libmediaart/extract.c b/libmediaart/extract.c
index 8ab81ee..7af2402 100644
--- a/libmediaart/extract.c
+++ b/libmediaart/extract.c
@@ -666,7 +666,10 @@ get_heuristic (MediaArtType type,
gboolean retval = FALSE;
if (title == NULL || title[0] == '\0') {
- g_debug ("Unable to fetch media art, no title specified");
+ g_set_error (error,
+ MEDIA_ART_ERROR,
+ MEDIA_ART_ERROR_NO_TITLE,
+ "Title is required, but was not provided, or was empty");
return FALSE;
}
diff --git a/libmediaart/extract.h b/libmediaart/extract.h
index 95ca6e7..68dd308 100644
--- a/libmediaart/extract.h
+++ b/libmediaart/extract.h
@@ -49,10 +49,9 @@ typedef enum {
/**
* MediaArtError:
- * @MEDIA_ART_ERROR_NOENT: The resource that the was passed (for example a
- * file or URI) does not exist.
* @MEDIA_ART_ERROR_NO_STORAGE: Storage information is unknown, we
* have no knowledge about removable media.
+ * @MEDIA_ART_ERROR_NO_TITLE: Title is required, but was not provided, or was empty.
*
* Enumeration values used in errors returned by the
* #MediaArtError API.
@@ -60,8 +59,8 @@ typedef enum {
* Since: 0.2
**/
typedef enum {
- MEDIA_ART_ERROR_NOENT,
- MEDIA_ART_ERROR_NO_STORAGE
+ MEDIA_ART_ERROR_NO_STORAGE,
+ MEDIA_ART_ERROR_NO_TITLE
} MediaArtError;
#define MEDIA_ART_ERROR media_art_error_quark ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]