[PATCH 06/11] youtube: updated to new date format



---
 src/media/youtube/grl-youtube.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/media/youtube/grl-youtube.c b/src/media/youtube/grl-youtube.c
index 19b68c5..1f4be94 100644
--- a/src/media/youtube/grl-youtube.c
+++ b/src/media/youtube/grl-youtube.c
@@ -556,9 +556,8 @@ build_media_from_entry (GrlYoutubeSource *source,
                                  gdata_media_thumbnail_get_uri (thumbnail));
         thumb_list = g_list_next (thumb_list);
       }
-    } else if (key == GRL_METADATA_KEY_DATE) {
+    } else if (key == GRL_METADATA_KEY_PUBLICATION_DATE) {
       GTimeVal date;
-      gchar *date_str;
 #ifdef GDATA_API_SUBJECT_TO_CHANGE
       gint64 published = gdata_entry_get_published (entry);
       date.tv_sec = (glong) published;
@@ -567,9 +566,10 @@ build_media_from_entry (GrlYoutubeSource *source,
       gdata_entry_get_published (entry, &date);
 #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);
+        GDateTime *date_time;
+        date_time = g_date_time_new_from_timeval_utc (&date);
+        grl_media_set_publication_date (media, date_time);
+        g_date_time_unref (date_time);
       }
     } else if (key == GRL_METADATA_KEY_DURATION) {
       grl_media_set_duration (media, gdata_youtube_video_get_duration (video));
@@ -1277,7 +1277,7 @@ grl_youtube_source_supported_keys (GrlMetadataSource *source)
 				      GRL_METADATA_KEY_EXTERNAL_URL,
                                       GRL_METADATA_KEY_DESCRIPTION,
                                       GRL_METADATA_KEY_DURATION,
-                                      GRL_METADATA_KEY_DATE,
+                                      GRL_METADATA_KEY_PUBLICATION_DATE,
                                       GRL_METADATA_KEY_THUMBNAIL,
                                       GRL_METADATA_KEY_MIME,
                                       GRL_METADATA_KEY_CHILDCOUNT,
-- 
1.7.4.1



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