[grilo-plugins] Fix build with latest gmime3



commit 4329dda2c53f9a7bd2a3f6dd9334d4eb5207e9fd
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Apr 12 21:27:58 2017 -0500

    Fix build with latest gmime3
    
    This has been broken for weeks....
    
    Also, drop support for older gmime since we're early in the release
    cycle and there's not really any compelling reason not to. Obviously
    this means there must be no more grilo-plugins releases until the next
    gmime release. If this is undesired then grilo-plugins could grow
    conditional support for both versions of gmime, but it seem pointless.

 configure.ac                |    8 ++------
 src/podcasts/grl-podcasts.c |   10 +++++-----
 2 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dc304b6..276e7a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,11 +164,7 @@ fi
 
 PKG_CHECK_MODULES([JSON], [json-glib-1.0], HAVE_JSON_GLIB=yes, HAVE_JSON_GLIB=no)
 
-PKG_CHECK_MODULES(GMIME, gmime-3.0,
-                         HAVE_GMIME=yes,
-                         [PKG_CHECK_MODULES(GMIME, gmime-2.6,
-                                                   HAVE_GMIME=yes,
-                                                   HAVE_GMIME=no)])
+PKG_CHECK_MODULES(GMIME, [gmime-3.0], HAVE_GMIME=yes, HAVE_GMIME=no)
 
 PKG_CHECK_MODULES(AVAHI, [avahi-gobject avahi-glib avahi-client], HAVE_AVAHI=yes, HAVE_AVAHI=no)
 
@@ -490,7 +486,7 @@ AC_ARG_ENABLE(podcasts,
                            AC_MSG_ERROR([sqlite3 not found, install it or use --disable-podcasts])
                         fi
                         if test "x$HAVE_GMIME" = "xno"; then
-                           AC_MSG_ERROR([gmime-2.4 or gmime-2.6 not found, install it or use 
--disable-podcasts])
+                           AC_MSG_ERROR([gmime-3.0 not found, install it or use --disable-podcasts])
                         fi
                         ;;
                 esac
diff --git a/src/podcasts/grl-podcasts.c b/src/podcasts/grl-podcasts.c
index 14a0868..953e63a 100644
--- a/src/podcasts/grl-podcasts.c
+++ b/src/podcasts/grl-podcasts.c
@@ -638,10 +638,8 @@ build_media (GrlMedia *content,
 
     grl_media_set_id (media, url);
     if (date) {
-      time_t t;
       GDateTime *date_time;
-      t = g_mime_utils_header_decode_date (date, NULL);
-      date_time = g_date_time_new_from_unix_utc (t);
+      date_time = g_mime_utils_header_decode_date (date);
       grl_media_set_publication_date (media, date_time);
       g_date_time_unref (date_time);
     }
@@ -1277,8 +1275,10 @@ parse_feed (OperationSpec *os, const gchar *str, GError **error)
   /* Check podcast pubDate (if available), if it has not been updated
      recently then we can use the cache and avoid parsing the feed */
   if (podcast_data->published != NULL) {
-    time_t pub_time =
-      g_mime_utils_header_decode_date (podcast_data->published, NULL);
+    GDateTime *date_time =
+      g_mime_utils_header_decode_date (podcast_data->published);
+    gint64 pub_time = g_date_time_to_unix (date_time);
+    g_date_time_unref (date_time);
     if (pub_time == 0) {
       GRL_DEBUG ("Invalid podcast pubDate: '%s'", podcast_data->published);
       /* We will parse the feed again just in case */


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