From d7f41453d85fa5e0f4d1a8c81ceda49a99be5227 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 25 Aug 2017 11:29:10 +0200 Subject: [PATCH] Revert "Fix build with latest gmime3" This reverts commit 4329dda2c53f9a7bd2a3f6dd9334d4eb5207e9fd. --- configure.ac | 8 ++++++-- src/podcasts/grl-podcasts.c | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index 90c985c..aeba852 100644 --- a/configure.ac +++ b/configure.ac @@ -164,7 +164,11 @@ 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, HAVE_GMIME=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(AVAHI, [avahi-gobject avahi-glib avahi-client], HAVE_AVAHI=yes, HAVE_AVAHI=no) @@ -486,7 +490,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-3.0 not found, install it or use --disable-podcasts]) + AC_MSG_ERROR([gmime-2.4 or gmime-2.6 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 953e63a..14a0868 100644 --- a/src/podcasts/grl-podcasts.c +++ b/src/podcasts/grl-podcasts.c @@ -638,8 +638,10 @@ build_media (GrlMedia *content, grl_media_set_id (media, url); if (date) { + time_t t; GDateTime *date_time; - date_time = g_mime_utils_header_decode_date (date); + t = g_mime_utils_header_decode_date (date, NULL); + date_time = g_date_time_new_from_unix_utc (t); grl_media_set_publication_date (media, date_time); g_date_time_unref (date_time); } @@ -1275,10 +1277,8 @@ 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) { - 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); + time_t pub_time = + g_mime_utils_header_decode_date (podcast_data->published, NULL); if (pub_time == 0) { GRL_DEBUG ("Invalid podcast pubDate: '%s'", podcast_data->published); /* We will parse the feed again just in case */ -- 2.13.5