Commit 14643ae6 authored by Bastien Nocera's avatar Bastien Nocera Committed by Victor Toso

podcasts: Remove gmime dependency

And use totem-pl-parser's helper function instead. totem-pl-parser
master has dropped that dependency on gmime.
parent 6c7a7938
Pipeline #21794 passed with stage
in 3 minutes and 38 seconds
......@@ -9,7 +9,7 @@ variables:
DEPENDENCIES: intltool sqlite-devel libgcrypt-devel itstool lua-devel
libsoup-devel gperf libarchive-devel json-glib-devel
avahi-gobject-devel totem-pl-parser-devel rest-devel
tracker-devel gmime30-devel libdmapsharing-devel libmediaart-devel
tracker-devel libdmapsharing-devel libmediaart-devel
gom-devel gnome-online-accounts-devel libgdata-devel
gstreamer1-plugins-good gstreamer1-plugins-bad-free-extras
......
......@@ -167,8 +167,6 @@ 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(AVAHI, [avahi-gobject avahi-glib avahi-client], HAVE_AVAHI=yes, HAVE_AVAHI=no)
PKG_CHECK_MODULES(MEDIAART, [libmediaart-2.0], HAVE_MEDIAART=yes, HAVE_MEDIAART=no)
......@@ -488,17 +486,13 @@ AC_ARG_ENABLE(podcasts,
if test "x$HAVE_SQLITE" = "xno"; then
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])
fi
;;
esac
],
[
if test "x$HAVE_GRLNET" = "xyes" -a \
"x$HAVE_XML" = "xyes" -a \
"x$HAVE_SQLITE" = "xyes" -a \
"x$HAVE_GMIME" = "xyes"; then
"x$HAVE_SQLITE" = "xyes"; then
enable_podcasts=yes
else
enable_podcasts=no
......@@ -516,9 +510,9 @@ PODCASTS_PLUGIN_ID="grl-podcasts"
AC_SUBST(PODCASTS_PLUGIN_ID)
AC_DEFINE_UNQUOTED([PODCASTS_PLUGIN_ID], ["$PODCASTS_PLUGIN_ID"], [Podcasts plugin ID])
DEPS_PODCASTS_CFLAGS="$DEPS_CFLAGS $GRLNET_CFLAGS $XML_CFLAGS $SQLITE_CFLAGS $GMIME_CFLAGS"
DEPS_PODCASTS_CFLAGS="$DEPS_CFLAGS $GRLNET_CFLAGS $XML_CFLAGS $SQLITE_CFLAGS"
AC_SUBST(DEPS_PODCASTS_CFLAGS)
DEPS_PODCASTS_LIBS="$DEPS_LIBS $GRLNET_LIBS $XML_LIBS $SQLITE_LIBS $GMIME_LIBS"
DEPS_PODCASTS_LIBS="$DEPS_LIBS $GRLNET_LIBS $XML_LIBS $SQLITE_LIBS"
AC_SUBST(DEPS_PODCASTS_LIBS)
# ----------------------------------------------------------
......
......@@ -41,7 +41,6 @@ avahi_glib_dep = dependency('avahi-glib', required: false)
avahi_gobject_dep = dependency('avahi-gobject', required: false)
gio_dep = dependency('gio-2.0', required: false)
gio_unix_dep = dependency('gio-unix-2.0', required: false)
gmime_dep = dependency('gmime-3.0', required: false)
goa_dep = dependency('goa-1.0', version: '>= 3.17.91', required: false)
gom_dep = dependency('gom-1.0', version: '>= 0.3.2', required: false)
grilo_net_dep = dependency('grilo-net-0.3', version: '>= 0.3.0', required: false)
......@@ -105,7 +104,7 @@ plugins = [ # NAME, REQ_DEPS, OPT_DEPS
['metadata-store', [sqlite3_dep], []],
['opensubtitles', [gio_dep, libsoup_dep], []],
['optical-media', [totem_plparser_dep], []],
['podcasts', [grilo_net_dep, libxml_dep, sqlite3_dep, gmime_dep], []],
['podcasts', [grilo_net_dep, libxml_dep, sqlite3_dep, totem_plparser_dep], []],
['raitv', [grilo_net_dep, libxml_dep], []],
['shoutcast', [grilo_net_dep, libxml_dep], []],
['thetvdb', [grilo_net_dep, libxml_dep, libarchive_dep, gom_dep], []],
......
......@@ -32,7 +32,7 @@
#include <libxml/xpath.h>
#include <sqlite3.h>
#include <string.h>
#include <gmime/gmime-utils.h>
#include <totem-pl-parser.h>
#include "grl-podcasts.h"
......@@ -631,10 +631,14 @@ build_media (GrlMedia *content,
grl_media_set_id (media, url);
if (date) {
GDateTime *date_time;
date_time = g_mime_utils_header_decode_date (date);
grl_media_set_publication_date (media, date_time);
g_date_time_unref (date_time);
guint64 epoch;
epoch = totem_pl_parser_parse_date (date, FALSE);
if (epoch != -1) {
GDateTime *time;
time = g_date_time_new_from_unix_utc (epoch);
grl_media_set_publication_date (media, time);
g_date_time_unref (time);
}
}
if (desc)
grl_media_set_description (media, desc);
......@@ -1268,11 +1272,9 @@ 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);
if (pub_time == 0) {
guint64 pub_time;
pub_time = totem_pl_parser_parse_date (podcast_data->published, FALSE);
if (pub_time != -1) {
GRL_DEBUG ("Invalid podcast pubDate: '%s'", podcast_data->published);
/* We will parse the feed again just in case */
} else if (os->last_refreshed >= pub_time) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment