[grilo-plugins] tmdb: Add grl_tmdb_request_detail_to_string()



commit a507aa2305e64da3c3cff8a322221a7018a7758f
Author: Mathias Hasselmann <mathias openismus com>
Date:   Wed Jan 2 21:31:58 2013 +0100

    tmdb: Add grl_tmdb_request_detail_to_string()

 src/tmdb/grl-tmdb-request.c |   27 +++++++++++++++++++++++++++
 src/tmdb/grl-tmdb-request.h |    3 +++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/tmdb/grl-tmdb-request.c b/src/tmdb/grl-tmdb-request.c
index 786133f..a5a4e8d 100644
--- a/src/tmdb/grl-tmdb-request.c
+++ b/src/tmdb/grl-tmdb-request.c
@@ -644,3 +644,30 @@ grl_tmdb_request_get_uri (GrlTmdbRequest *self)
 {
   return self->priv->uri;
 }
+
+/**
+ * grl_tmdb_request_detail_to_string:
+ * @detail: A #GrlTmdbRequestDetail
+ * Returns: A description of the detail or %NULL for invalid details.
+ */
+const char *
+grl_tmdb_request_detail_to_string (GrlTmdbRequestDetail detail)
+{
+  switch (detail) {
+    case GRL_TMDB_REQUEST_DETAIL_MOVIE:
+      return "generic details";
+    case GRL_TMDB_REQUEST_DETAIL_MOVIE_CAST:
+      return "casts";
+    case GRL_TMDB_REQUEST_DETAIL_MOVIE_IMAGES:
+      return "images";
+    case GRL_TMDB_REQUEST_DETAIL_MOVIE_KEYWORDS:
+      return "keywords";
+    case GRL_TMDB_REQUEST_DETAIL_MOVIE_RELEASE_INFO:
+      return "release information";
+    case GRL_TMDB_REQUEST_DETAIL_COUNT:
+      break;
+  }
+
+  g_warn_if_reached ();
+  return NULL;
+}
diff --git a/src/tmdb/grl-tmdb-request.h b/src/tmdb/grl-tmdb-request.h
index 0343ce1..c295fd5 100644
--- a/src/tmdb/grl-tmdb-request.h
+++ b/src/tmdb/grl-tmdb-request.h
@@ -130,4 +130,7 @@ grl_tmdb_request_get_string_list_with_filter (GrlTmdbRequest *self,
                                               const char *path,
                                               GrlTmdbRequestStringFilterFunc filter);
 
+const char *
+grl_tmdb_request_detail_to_string (GrlTmdbRequestDetail detail);
+
 #endif /* _GRL_TMDB_REQUEST_H_ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]