[grilo-plugins] youtube: update the libgdata 0.7 API



commit f23c3cd201d20347065993c52a7f6be2d555d766
Author: Víctor Manuel Jáquez Leal <vjaquez igalia com>
Date:   Tue Nov 9 12:53:17 2010 +0100

    youtube: update the libgdata 0.7 API
    
    Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez igalia com>

 src/youtube/grl-youtube.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/youtube/grl-youtube.c b/src/youtube/grl-youtube.c
index 9e05a06..dca73b2 100644
--- a/src/youtube/grl-youtube.c
+++ b/src/youtube/grl-youtube.c
@@ -626,10 +626,17 @@ build_media_from_entry (GrlMedia *content,
     } else if (iter->data == GRL_METADATA_KEY_DATE) {
       GTimeVal date;
       gchar *date_str;
+#ifdef GDATA_API_SUBJECT_TO_CHANGE
+      gint64 published = gdata_entry_get_published (entry);
+      date.tv_sec = (glong) published;
+#else
       gdata_entry_get_published (entry, &date);
-      date_str = g_time_val_to_iso8601 (&date);
-      grl_media_set_date (media, date_str);
-      g_free (date_str);
+#endif
+      if (date.tv_sec != 0 || date.tv_usec != 0) {
+        date_str = g_time_val_to_iso8601 (&date);
+        grl_media_set_date (media, date_str);
+        g_free (date_str);
+      }
     } else if (iter->data == GRL_METADATA_KEY_DURATION) {
       grl_media_set_duration (media, gdata_youtube_video_get_duration (video));
     } else if (iter->data == GRL_METADATA_KEY_MIME) {



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