summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2015-07-21 20:06:43 +0200
committerBastien Nocera <hadess@hadess.net>2015-07-23 18:31:08 +0200
commit8e3135b41f73e065d47a69d7cb84aab534079847 (patch)
treea44066bce7cf7e66c1a0b815d61ff26ed6760ebf
parentedb26e0e3a5447e47e9d3e9d4f300dd8457a8468 (diff)
downloadgrilo-plugins-8e3135b41f73e065d47a69d7cb84aab534079847.tar.gz
apple-trailers: Remove stand-alone C apple-trailers plugin
Note that this removes, but does not migrate the tests, as those were already broken. The trailers rotate and change, and using information like this is bound to get outdated. https://bugzilla.gnome.org/show_bug.cgi?id=752681
-rw-r--r--configure.ac45
-rw-r--r--po/POTFILES.in1
-rw-r--r--src/Makefile.am6
-rw-r--r--src/apple-trailers/Makefile.am58
-rw-r--r--src/apple-trailers/apple-trailers.gresource.xml6
-rw-r--r--src/apple-trailers/channel-trailers.svg107
-rw-r--r--src/apple-trailers/grl-apple-trailers.c623
-rw-r--r--src/apple-trailers/grl-apple-trailers.h78
-rw-r--r--src/apple-trailers/grl-apple-trailers.xml10
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/apple-trailers/Makefile.am34
-rw-r--r--tests/apple-trailers/data/apple-trailers.data2
-rw-r--r--tests/apple-trailers/data/network-data.ini6
-rw-r--r--tests/apple-trailers/test_apple_trailers.c164
14 files changed, 1 insertions, 1144 deletions
diff --git a/configure.ac b/configure.ac
index bdc98c3..8d46429 100644
--- a/configure.ac
+++ b/configure.ac
@@ -644,49 +644,6 @@ DEPS_SHOUTCAST_LIBS="$DEPS_LIBS $GRLNET_LIBS $XML_LIBS"
AC_SUBST(DEPS_SHOUTCAST_LIBS)
# ----------------------------------------------------------
-# BUILD APPLE TRAILERS PLUGIN
-# ----------------------------------------------------------
-
-AC_ARG_ENABLE(apple_trailers,
- AC_HELP_STRING([--enable-apple-trailers],
- [enable Apple Movie Trailers plugin (default: auto)]),
- [
- case "$enableval" in
- yes)
- if test "x$HAVE_GRLNET" = "xno"; then
- AC_MSG_ERROR([grilo-net-0.2 >= 0.2.2 not found, install it or use --disable-apple-trailers])
- fi
- if test "x$HAVE_XML" = "xno"; then
- AC_MSG_ERROR([libxml-2.0 not found, install it or use --disable-apple-trailers])
- fi
- ;;
- esac
- ],
- [
- if test "x$HAVE_GRLNET" = "xyes" -a "x$HAVE_XML" = "xyes"; then
- enable_apple_trailers=yes
- else
- enable_apple_trailers=no
- fi
- ])
-
-AM_CONDITIONAL([APPLE_TRAILERS_PLUGIN], [test "x$enable_apple_trailers" = "xyes"])
-GRL_PLUGINS_ALL="$GRL_PLUGINS_ALL apple-trailers"
-if test "x$enable_apple_trailers" = "xyes"
-then
- GRL_PLUGINS_ENABLED="$GRL_PLUGINS_ENABLED apple-trailers"
-fi
-
-APPLE_TRAILERS_PLUGIN_ID="grl-apple-trailers"
-AC_SUBST(APPLE_TRAILERS_PLUGIN_ID)
-AC_DEFINE_UNQUOTED([APPLE_TRAILERS_PLUGIN_ID], ["$APPLE_TRAILERS_PLUGIN_ID"], [Apple Trailers plugin ID])
-
-DEPS_APPLE_TRAILERS_CFLAGS="$DEPS_CFLAGS $GRLNET_CFLAGS $XML_CFLAGS"
-AC_SUBST(DEPS_APPLE_TRAILERS_CFLAGS)
-DEPS_APPLE_TRAILERS_LIBS="$DEPS_LIBS $GRLNET_LIBS $XML_LIBS"
-AC_SUBST(DEPS_APPLE_TRAILERS_LIBS)
-
-# ----------------------------------------------------------
# BUILD MAGNATUNE PLUGIN
# ----------------------------------------------------------
@@ -1375,7 +1332,6 @@ AC_CONFIG_FILES([
po/Makefile.in
po/Makefile
src/Makefile
- src/apple-trailers/Makefile
src/bliptv/Makefile
src/bookmarks/Makefile
src/dleyna/Makefile
@@ -1402,7 +1358,6 @@ AC_CONFIG_FILES([
src/vimeo/Makefile
src/youtube/Makefile
tests/Makefile
- tests/apple-trailers/Makefile
tests/bliptv/Makefile
tests/dleyna/Makefile
tests/dleyna/dbusmock/dleyna-server-mock.service
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 45c1ecd..de00787 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,4 +1,3 @@
-src/apple-trailers/grl-apple-trailers.c
src/bliptv/grl-bliptv.c
src/bookmarks/grl-bookmarks.c
src/dleyna/grl-dleyna-source.c
diff --git a/src/Makefile.am b/src/Makefile.am
index d0b9e14..cfc25bd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -10,10 +10,6 @@ include $(top_srcdir)/gtester.mk
SUBDIRS =
-if APPLE_TRAILERS_PLUGIN
-SUBDIRS += apple-trailers
-endif
-
if BLIPTV_PLUGIN
SUBDIRS += bliptv
endif
@@ -111,7 +107,7 @@ SUBDIRS += opensubtitles
endif
DIST_SUBDIRS = \
- apple-trailers bliptv bookmarks dleyna dmap filesystem flickr freebox gravatar jamendo \
+ bliptv bookmarks dleyna dmap filesystem flickr freebox gravatar jamendo \
lastfm-albumart local-metadata lua-factory magnatune metadata-store opensubtitles \
optical-media podcasts raitv shoutcast thetvdb tmdb tracker vimeo youtube
diff --git a/src/apple-trailers/Makefile.am b/src/apple-trailers/Makefile.am
deleted file mode 100644
index b53427e..0000000
--- a/src/apple-trailers/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-#
-# Makefile.am
-#
-# Author: Juan A. Suarez Romero <jasuarez@igalia.com>
-#
-# Copyright (C) 2010, 2011 Igalia S.L. All rights reserved.
-
-include $(top_srcdir)/gtester.mk
-
-ext_LTLIBRARIES = libgrlappletrailers.la
-
-libgrlappletrailers_la_CFLAGS = \
- $(DEPS_APPLE_TRAILERS_CFLAGS) \
- -DG_LOG_DOMAIN=\"GrlAppleTrailers\" \
- -DLOCALEDIR=\"$(localedir)\"
-
-libgrlappletrailers_la_LIBADD = \
- $(DEPS_APPLE_TRAILERS_LIBS)
-
-libgrlappletrailers_la_LDFLAGS = \
- -no-undefined \
- -module \
- -avoid-version
-
-libgrlappletrailers_la_SOURCES = \
- grl-apple-trailers.c \
- grl-apple-trailers.h
-nodist_libgrlappletrailers_la_SOURCES = \
- $(resource_sources)
-
-extdir = $(GRL_PLUGINS_DIR)
-appletrailersxmldir = $(GRL_PLUGINS_DIR)
-appletrailersxml_DATA = $(APPLE_TRAILERS_PLUGIN_ID).xml
-
-# This lets us test the plugin without installing it,
-# because grilo expects the .so and .xml files to be in
-# the same directory:
-copy-xml-to-libs-dir: libgrlappletrailers.la
- cp -f $(srcdir)/$(appletrailersxml_DATA) $(builddir)/.libs/
-
-all-local: copy-xml-to-libs-dir
-
-apple-trailersresources.h: apple-trailers.gresource.xml
- $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/apple-trailers.gresource.xml \
- --target=$@ --sourcedir=$(srcdir) --c-name _grl_apple_trailers --generate-header
-apple-trailersresources.c: apple-trailers.gresource.xml apple-trailersresources.h channel-trailers.svg
- $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) $(srcdir)/apple-trailers.gresource.xml \
- --target=$@ --sourcedir=$(srcdir) --c-name _grl_apple_trailers --generate-source
-
-resource_sources = \
- apple-trailersresources.h \
- apple-trailersresources.c \
- $(NULL)
-CLEANFILES = $(resource_sources)
-
-EXTRA_DIST += $(appletrailersxml_DATA) channel-trailers.svg apple-trailers.gresource.xml
-
--include $(top_srcdir)/git.mk
diff --git a/src/apple-trailers/apple-trailers.gresource.xml b/src/apple-trailers/apple-trailers.gresource.xml
deleted file mode 100644
index 98898a8..0000000
--- a/src/apple-trailers/apple-trailers.gresource.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
- <gresource prefix="/org/gnome/grilo/plugins/apple-trailers">
- <file compressed="false">channel-trailers.svg</file>
- </gresource>
-</gresources>
diff --git a/src/apple-trailers/channel-trailers.svg b/src/apple-trailers/channel-trailers.svg
deleted file mode 100644
index e58eeea..0000000
--- a/src/apple-trailers/channel-trailers.svg
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="256"
- height="256"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.4 r9939"
- sodipodi:docname="channel-bliptv.svg">
- <defs
- id="defs4">
- <clipPath
- id="clipPath6193"
- clipPathUnits="userSpaceOnUse">
- <path
- id="path6195"
- d="m 1600,2252.8 5020,0 0,3650 -5020,0 0,-3650 z" />
- </clipPath>
- <linearGradient
- id="linearGradient6181"
- spreadMethod="pad"
- gradientTransform="matrix(-3.593e-5,822,822,3.593e-5,411,0)"
- gradientUnits="userSpaceOnUse"
- y2="0"
- x2="1"
- y1="0"
- x1="0">
- <stop
- id="stop6183"
- offset="0"
- style="stop-opacity:1;stop-color:#c01e25" />
- <stop
- id="stop6185"
- offset="1"
- style="stop-opacity:1;stop-color:#e62426" />
- </linearGradient>
- <clipPath
- id="clipPath6177"
- clipPathUnits="userSpaceOnUse">
- <path
- id="path6179"
- d="M 8220,0 0,0 l 0,8220 8220,0 0,-8220 m -6620,5902.8 0,-3650 5020,0 0,3650 -5020,0" />
- </clipPath>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#505050"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:zoom="1"
- inkscape:cx="222.0001"
- inkscape:cy="70.020428"
- inkscape:document-units="px"
- inkscape:current-layer="g7299"
- showgrid="false"
- borderlayer="true"
- inkscape:showpageshadow="false"
- inkscape:window-width="2560"
- inkscape:window-height="1374"
- inkscape:window-x="0"
- inkscape:window-y="27"
- inkscape:window-maximized="1" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-796.36218)">
- <g
- transform="matrix(630.025,0,0,-458.9,-77.5125,1218.8747)"
- id="g6197" />
- <g
- id="g7288"
- transform="translate(551.5,989.9982)">
- <g
- id="g7299"
- transform="matrix(0.89344262,0,0,0.89344262,-396.25,-32.797277)">
- <path
- style="color:#000000;fill:#73a444;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="M 128 20 C 67.800965 20 19 68.800965 19 129 C 19 189.19904 67.800965 238 128 238 C 188.19904 238 237 189.19904 237 129 C 237 68.800965 188.19904 20 128 20 z M 114.0625 80.375 C 122.24545 80.375 129.30417 84.775651 133.1875 91.34375 C 137.07083 84.775651 144.12955 80.375 152.3125 80.375 C 164.63538 80.375 174.625 90.364625 174.625 102.6875 C 174.625 109.82355 171.27566 116.13442 166.0625 120.21875 C 167.40093 121.38569 168.25 123.07666 168.25 125 C 168.23725 137.75 168.25 144.45727 168.25 163.25 C 168.25 166.78175 165.40675 169.625 161.875 169.625 L 104.5 169.625 C 100.96825 169.625 98.125 166.78175 98.125 163.25 L 98.125 149.5 L 81.8125 161.65625 C 81.688825 161.73913 81.547137 161.7953 81.40625 161.84375 C 81.209262 161.87563 81.009488 161.87563 80.8125 161.84375 C 80.680538 161.8565 80.538212 161.8565 80.40625 161.84375 C 80.265362 161.79275 80.123675 161.73913 80 161.65625 C 79.859112 161.60525 79.717426 161.55226 79.59375 161.46875 C 79.522355 161.405 79.466813 161.3214 79.40625 161.25 C 79.334855 161.18625 79.279313 161.1339 79.21875 161.0625 C 79.13524 160.93882 79.04845 160.79714 79 160.65625 C 78.987251 160.52429 78.987251 160.38196 79 160.25 L 79 121.625 C 78.987251 121.49304 78.987251 121.35071 79 121.21875 C 79.050998 121.07786 79.135238 120.93617 79.21875 120.8125 C 79.282497 120.7411 79.334851 120.68556 79.40625 120.625 C 79.469997 120.5536 79.522351 120.46681 79.59375 120.40625 C 79.657497 120.33485 79.7411 120.27931 79.8125 120.21875 C 79.876247 120.14735 79.9286 120.09181 80 120.03125 C 80.123675 119.94837 80.265363 119.86095 80.40625 119.8125 C 80.603238 119.78062 80.803012 119.78062 81 119.8125 C 81.066302 119.80866 81.121199 119.80866 81.1875 119.8125 C 81.258895 119.87625 81.345687 119.95985 81.40625 120.03125 C 81.547137 120.08225 81.688825 120.13524 81.8125 120.21875 L 98.125 132.375 L 98.125 125 C 98.125 123.07666 98.974068 121.38569 100.3125 120.21875 C 95.099344 116.13441 91.75 109.82355 91.75 102.6875 C 91.75 90.364625 101.73962 80.375 114.0625 80.375 z M 114.0625 93.125 C 108.78126 93.125 104.5 97.406259 104.5 102.6875 C 104.5 107.96874 108.78126 112.25 114.0625 112.25 C 119.34374 112.25 123.625 107.96874 123.625 102.6875 C 123.625 97.406259 119.34374 93.125 114.0625 93.125 z M 152.3125 93.125 C 147.03126 93.125 142.75 97.406259 142.75 102.6875 C 142.75 107.96874 147.03126 112.25 152.3125 112.25 C 157.59374 112.25 161.875 107.96874 161.875 102.6875 C 161.875 97.406259 157.59374 93.125 152.3125 93.125 z M 133.1875 114.03125 C 132.17968 115.73586 131.03426 117.25093 129.625 118.625 L 136.78125 118.625 C 135.37199 117.25093 134.19532 115.73586 133.1875 114.03125 z "
- transform="matrix(1.1192661,0,0,1.1192661,-173.76606,-180.02135)"
- id="path7297" />
- </g>
- </g>
- </g>
-</svg>
diff --git a/src/apple-trailers/grl-apple-trailers.c b/src/apple-trailers/grl-apple-trailers.c
deleted file mode 100644
index de36173..0000000
--- a/src/apple-trailers/grl-apple-trailers.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 Igalia S.L.
- * Copyright (C) 2011 Intel Corporation.
- *
- * Contact: Iago Toral Quiroga <itoral@igalia.com>
- *
- * Authors: Juan A. Suarez Romero <jasuarez@igalia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <grilo.h>
-#include <net/grl-net.h>
-#include <libxml/xpath.h>
-#include <glib/gi18n-lib.h>
-
-#include "grl-apple-trailers.h"
-
-/* --------- Logging -------- */
-
-#define GRL_LOG_DOMAIN_DEFAULT apple_trailers_log_domain
-GRL_LOG_DOMAIN_STATIC(apple_trailers_log_domain);
-
-/* ---- Apple Trailers Service ---- */
-
-#define APPLE_TRAILERS_CURRENT_SD \
- "http://trailers.apple.com/trailers/home/xml/current_480p.xml"
-
-#define APPLE_TRAILERS_CURRENT_HD \
- "http://trailers.apple.com/trailers/home/xml/current_720p.xml"
-
-/* --- Plugin information --- */
-
-#define PLUGIN_ID APPLE_TRAILERS_PLUGIN_ID
-
-#define SOURCE_ID "grl-apple-trailers"
-#define SOURCE_NAME _("Apple Movie Trailers")
-#define SOURCE_DESC _("A plugin for browsing Apple Movie Trailers")
-
-typedef struct {
- GrlSourceBrowseSpec *bs;
- GCancellable *cancellable;
- xmlDocPtr xml_doc;
- xmlNodePtr xml_entries;
-} OperationData;
-
-enum {
- PROP_0,
- PROP_HD,
- PROP_LARGE_POSTER,
-};
-
-struct _GrlAppleTrailersSourcePriv {
- GrlNetWc *wc;
- gboolean hd;
- gboolean large_poster;
-};
-
-#define GRL_APPLE_TRAILERS_SOURCE_GET_PRIVATE(object) \
- (G_TYPE_INSTANCE_GET_PRIVATE((object), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE, \
- GrlAppleTrailersSourcePriv))
-
-static GrlAppleTrailersSource *grl_apple_trailers_source_new (gboolean hd,
- gboolean xlarge);
-
-gboolean grl_apple_trailers_plugin_init (GrlRegistry *registry,
- GrlPlugin *plugin,
- GList *configs);
-
-static const GList *grl_apple_trailers_source_supported_keys (GrlSource *source);
-
-static void grl_apple_trailers_source_browse (GrlSource *source,
- GrlSourceBrowseSpec *bs);
-
-static void grl_apple_trailers_source_cancel (GrlSource *source,
- guint operation_id);
-
-/* =================== Apple Trailers Plugin =============== */
-
-gboolean
-grl_apple_trailers_plugin_init (GrlRegistry *registry,
- GrlPlugin *plugin,
- GList *configs)
-{
- GrlAppleTrailersSource *source;
- gboolean hd = FALSE;
- gboolean xlarge = FALSE;
-
- GRL_LOG_DOMAIN_INIT (apple_trailers_log_domain, "apple-trailers");
-
- GRL_DEBUG ("apple_trailers_plugin_init");
-
- /* Initialize i18n */
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-
- for (; configs; configs = g_list_next (configs)) {
- GrlConfig *config;
- gchar *definition, *poster_size;
-
- config = GRL_CONFIG (configs->data);
- definition = grl_config_get_string (config, "definition");
- if (definition) {
- if (*definition != '\0') {
- if (g_str_equal (definition, "hd")) {
- hd = TRUE;
- }
- }
- g_free (definition);
- }
-
- poster_size = grl_config_get_string (config, "poster-size");
- if (poster_size) {
- if (*poster_size != '\0') {
- if (g_str_equal (poster_size, "xlarge")) {
- xlarge = TRUE;
- }
- }
- g_free (poster_size);
- }
- }
-
- source = grl_apple_trailers_source_new (hd, xlarge);
- grl_registry_register_source (registry,
- plugin,
- GRL_SOURCE (source),
- NULL);
- return TRUE;
-}
-
-GRL_PLUGIN_REGISTER (grl_apple_trailers_plugin_init,
- NULL,
- PLUGIN_ID);
-
-/* ================== AppleTrailers GObject ================ */
-
-static GrlAppleTrailersSource *
-grl_apple_trailers_source_new (gboolean high_definition,
- gboolean xlarge)
-{
- GrlAppleTrailersSource *source;
- GIcon *icon;
- GFile *file;
- const char *tags[] = {
- "country:us",
- "cinema",
- "net:internet",
- NULL
- };
-
- GRL_DEBUG ("grl_apple_trailers_source_new%s%s",
- high_definition ? " (HD)" : "",
- xlarge ? " (X-large poster)" : "");
- file = g_file_new_for_uri ("resource:///org/gnome/grilo/plugins/apple-trailers/channel-trailers.svg");
- icon = g_file_icon_new (file);
- g_object_unref (file);
- source = g_object_new (GRL_APPLE_TRAILERS_SOURCE_TYPE,
- "source-id", SOURCE_ID,
- "source-name", SOURCE_NAME,
- "source-desc", SOURCE_DESC,
- "supported-media", GRL_MEDIA_TYPE_VIDEO,
- "high-definition", high_definition,
- "large-poster", xlarge,
- "source-icon", icon,
- "source-tags", tags,
- NULL);
- g_object_unref (icon);
-
- return source;
-}
-
-G_DEFINE_TYPE (GrlAppleTrailersSource, grl_apple_trailers_source, GRL_TYPE_SOURCE);
-
-static void
-grl_apple_trailers_source_finalize (GObject *object)
-{
- GrlAppleTrailersSource *self;
-
- self = GRL_APPLE_TRAILERS_SOURCE (object);
-
- g_clear_object (&self->priv->wc);
-
- G_OBJECT_CLASS (grl_apple_trailers_source_parent_class)->finalize (object);
-}
-
-static void
-grl_apple_trailers_source_set_property (GObject *object,
- guint propid,
- const GValue *value,
- GParamSpec *pspec)
-{
- GrlAppleTrailersSource *self;
- self = GRL_APPLE_TRAILERS_SOURCE (object);
-
- switch (propid) {
- case PROP_HD:
- self->priv->hd = g_value_get_boolean (value);
- break;
- case PROP_LARGE_POSTER:
- self->priv->large_poster = g_value_get_boolean (value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, propid, pspec);
- }
-}
-
-static void
-grl_apple_trailers_source_class_init (GrlAppleTrailersSourceClass * klass)
-{
- GrlSourceClass *source_class = GRL_SOURCE_CLASS (klass);
- GObjectClass *g_class = G_OBJECT_CLASS (klass);
-
- g_class->finalize = grl_apple_trailers_source_finalize;
- g_class->set_property = grl_apple_trailers_source_set_property;
-
- source_class->cancel = grl_apple_trailers_source_cancel;
- source_class->supported_keys = grl_apple_trailers_source_supported_keys;
- source_class->browse = grl_apple_trailers_source_browse;
-
- g_object_class_install_property (g_class,
- PROP_HD,
- g_param_spec_boolean ("high-definition",
- "hd",
- "Hi/Low definition videos",
- TRUE,
- G_PARAM_WRITABLE
- | G_PARAM_CONSTRUCT_ONLY
- | G_PARAM_STATIC_NAME));
-
- g_object_class_install_property (g_class,
- PROP_LARGE_POSTER,
- g_param_spec_boolean ("large-poster",
- "xlarge",
- "Pick large poster",
- TRUE,
- G_PARAM_WRITABLE
- | G_PARAM_CONSTRUCT_ONLY
- | G_PARAM_STATIC_NAME));
-
- g_type_class_add_private (klass, sizeof (GrlAppleTrailersSourcePriv));
-}
-
-static void
-grl_apple_trailers_source_init (GrlAppleTrailersSource *source)
-{
- source->priv = GRL_APPLE_TRAILERS_SOURCE_GET_PRIVATE (source);
- source->priv->hd = TRUE;
-}
-
-/* ==================== Private ==================== */
-
-static gchar *
-get_node_value (xmlNodePtr node, const gchar *node_id)
-{
- gchar *value;
- xmlXPathContextPtr xpath_ctx;
- xmlXPathObjectPtr xpath_res;
-
- xpath_ctx = xmlXPathNewContext (node->doc);
- if (!xpath_ctx) {
- return NULL;
- }
-
- xpath_res = xmlXPathEvalExpression ((xmlChar *) node_id, xpath_ctx);
- if (!xpath_res) {
- xmlXPathFreeContext (xpath_ctx);
- return NULL;
- }
-
- if (xpath_res->nodesetval->nodeTab) {
- value =
- (gchar *) xmlNodeListGetString (node->doc,
- xpath_res->nodesetval->nodeTab[0]->xmlChildrenNode,
- 1);
- } else {
- value = NULL;
- }
-
- xmlXPathFreeObject (xpath_res);
- xmlXPathFreeContext (xpath_ctx);
-
- return value;
-}
-
-static gint
-runtime_to_seconds (const gchar *runtime)
-{
- gchar **items;
- gint seconds;
-
- if (!runtime) {
- return 0;
- }
-
- seconds = 0;
- items = g_strsplit (runtime, ":", -1);
- if (items && items[0] && items[1])
- seconds = 60 * atoi (items[0]) + atoi (items[1]);
- g_strfreev (items);
-
- return seconds;
-}
-static GrlMedia *
-build_media_from_movie (xmlNodePtr node, gboolean xlarge)
-{
- GrlMedia * media;
- gchar *movie_author;
- gchar *movie_date;
- gchar *movie_description;
- gchar *movie_duration;
- gchar *movie_genre;
- gchar *movie_id;
- gchar *movie_thumbnail;
- gchar *movie_title;
- gchar *movie_url;
- gchar *movie_rating;
- gchar *movie_studio;
- gchar *movie_copyright;
- GDateTime *date;
-
- media = grl_media_video_new ();
-
- movie_id = (gchar *) xmlGetProp (node, (const xmlChar *) "id");
-
- /* HACK: as get_node_value applies xpath expression from root node, but we
- want to do from current node, dup the node and mark it as root node */
-
- xmlDocPtr xml_doc = xmlNewDoc ((const xmlChar *) "1.0");
- xmlNodePtr node_dup = xmlCopyNode (node, 1);
- xmlDocSetRootElement (xml_doc, node_dup);
- movie_author = get_node_value (node_dup, "/movieinfo/info/director");
- movie_date = get_node_value (node_dup, "/movieinfo/info/releasedate");
- movie_description = get_node_value (node_dup, "/movieinfo/info/description");
- movie_duration = get_node_value (node_dup, "/movieinfo/info/runtime");
- movie_title = get_node_value (node_dup, "/movieinfo/info/title");
- movie_genre = get_node_value (node_dup, "/movieinfo/genre/name");
- if (xlarge)
- movie_thumbnail = get_node_value (node_dup, "/movieinfo/poster/xlarge");
- else
- movie_thumbnail = get_node_value (node_dup, "/movieinfo/poster/location");
- movie_url = get_node_value (node_dup, "/movieinfo/preview/large");
- movie_rating = get_node_value (node_dup, "/movieinfo/info/rating");
- movie_studio = get_node_value (node_dup, "/movieinfo/info/studio");
- movie_copyright = get_node_value (node_dup, "/movieinfo/info/copyright");
- xmlFreeDoc (xml_doc);
-
- grl_media_set_id (media, movie_id);
- grl_media_set_author (media, movie_author);
- if (movie_date)
- date = grl_date_time_from_iso8601 (movie_date);
- else
- date = NULL;
- if (date) {
- grl_media_set_publication_date (media, date);
- g_date_time_unref (date);
- }
- grl_media_set_description (media, movie_description);
- grl_media_set_duration (media, runtime_to_seconds (movie_duration));
- grl_media_set_title (media, movie_title);
- grl_data_set_string (GRL_DATA (media),
- GRL_METADATA_KEY_GENRE,
- movie_genre);
- grl_media_set_thumbnail (media, movie_thumbnail);
- grl_media_set_url (media, movie_url);
- grl_media_set_certificate (media, movie_rating);
- grl_media_set_studio (media, movie_studio);
-
- grl_media_set_mime (media, "video/mp4");
-
- /* FIXME: Translation */
- grl_media_set_license (media, movie_copyright);
-
- g_free (movie_id);
- g_free (movie_author);
- g_free (movie_date);
- g_free (movie_description);
- g_free (movie_duration);
- g_free (movie_title);
- g_free (movie_genre);
- g_free (movie_thumbnail);
- g_free (movie_url);
- g_free (movie_rating);
- g_free (movie_studio);
- g_free (movie_copyright);
-
- return media;
-}
-
-static gboolean
-send_movie_info (OperationData *op_data)
-{
- GrlMedia *media;
- gboolean last = FALSE;
-
- if (g_cancellable_is_cancelled (op_data->cancellable)) {
- op_data->bs->callback (op_data->bs->source,
- op_data->bs->operation_id,
- NULL,
- 0,
- op_data->bs->user_data,
- NULL);
- last = TRUE;
- } else {
- GrlAppleTrailersSource *source =
- GRL_APPLE_TRAILERS_SOURCE (op_data->bs->source);
- gint count = grl_operation_options_get_count (op_data->bs->options);
-
- media = build_media_from_movie (op_data->xml_entries,
- source->priv->large_poster);
- last =
- !op_data->xml_entries->next || count == 1;
-
- op_data->bs->callback (op_data->bs->source,
- op_data->bs->operation_id,
- media,
- last? 0: -1,
- op_data->bs->user_data,
- NULL);
- op_data->xml_entries = op_data->xml_entries->next;
- if (!last)
- grl_operation_options_set_count (op_data->bs->options, count - 1);
- }
-
- if (last) {
- xmlFreeDoc (op_data->xml_doc);
- g_object_unref (op_data->cancellable);
- g_slice_free (OperationData, op_data);
- }
-
- return !last;
-}
-
-static void
-xml_parse_result (const gchar *str, OperationData *op_data)
-{
- GError *error = NULL;
- xmlNodePtr node;
- guint skip = grl_operation_options_get_skip (op_data->bs->options);
-
- if (g_cancellable_is_cancelled (op_data->cancellable) ||
- grl_operation_options_get_count (op_data->bs->options) == 0) {
- goto finalize;
- }
-
- op_data->xml_doc = xmlReadMemory (str, xmlStrlen ((xmlChar*) str), NULL, NULL,
- XML_PARSE_RECOVER | XML_PARSE_NOBLANKS);
- if (!op_data->xml_doc) {
- error = g_error_new_literal (GRL_CORE_ERROR,
- GRL_CORE_ERROR_BROWSE_FAILED,
- _("Failed to parse response"));
- goto finalize;
- }
-
- node = xmlDocGetRootElement (op_data->xml_doc);
- if (!node || !node->xmlChildrenNode) {
- error = g_error_new_literal (GRL_CORE_ERROR,
- GRL_CORE_ERROR_BROWSE_FAILED,
- _("Empty response"));
- goto finalize;
- }
-
- node = node->xmlChildrenNode;
-
- /* Skip elements */
- while (node && skip > 0) {
- node = node->next;
- skip--;
- }
- grl_operation_options_set_skip (op_data->bs->options, skip);
-
- if (!node) {
- goto finalize;
- } else {
- guint id;
- op_data->xml_entries = node;
- id = g_idle_add ((GSourceFunc) send_movie_info, op_data);
- g_source_set_name_by_id (id, "[apple-trailers] send_movie_info");
- }
-
- return;
-
- finalize:
- op_data->bs->callback (op_data->bs->source,
- op_data->bs->operation_id,
- NULL,
- 0,
- op_data->bs->user_data,
- error);
-
- g_clear_pointer (&op_data->xml_doc, (GDestroyNotify) xmlFreeDoc);
- g_clear_error (&error);
- g_object_unref (op_data->cancellable);
- g_slice_free (OperationData, op_data);
-}
-
-static void
-read_done_cb (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
-{
- GError *error = NULL;
- GError *wc_error = NULL;
- OperationData *op_data = (OperationData *) user_data;
- gchar *content = NULL;
-
- if (!grl_net_wc_request_finish (GRL_NET_WC (source_object),
- res,
- &content,
- NULL,
- &wc_error)) {
- error = g_error_new (GRL_CORE_ERROR,
- GRL_CORE_ERROR_BROWSE_FAILED,
- _("Failed to connect: %s"),
- wc_error->message);
- op_data->bs->callback (op_data->bs->source,
- op_data->bs->operation_id,
- NULL,
- 0,
- op_data->bs->user_data,
- error);
- g_error_free (wc_error);
- g_error_free (error);
- g_object_unref (op_data->cancellable);
- g_slice_free (OperationData, op_data);
-
- return;
- }
-
- xml_parse_result (content, op_data);
-}
-
-static void
-read_url_async (GrlAppleTrailersSource *source,
- const gchar *url,
- OperationData *op_data)
-{
- if (!source->priv->wc)
- source->priv->wc = grl_net_wc_new ();
-
- GRL_DEBUG ("Opening '%s'", url);
- grl_net_wc_request_async (source->priv->wc,
- url,
- op_data->cancellable,
- read_done_cb,
- op_data);
-}
-
-/* ================== API Implementation ================ */
-
-static const GList *
-grl_apple_trailers_source_supported_keys (GrlSource *source)
-{
- static GList *keys = NULL;
- if (!keys) {
- keys = grl_metadata_key_list_new (GRL_METADATA_KEY_AUTHOR,
- GRL_METADATA_KEY_PUBLICATION_DATE,
- GRL_METADATA_KEY_DESCRIPTION,
- GRL_METADATA_KEY_DURATION,
- GRL_METADATA_KEY_GENRE,
- GRL_METADATA_KEY_ID,
- GRL_METADATA_KEY_THUMBNAIL,
- GRL_METADATA_KEY_TITLE,
- GRL_METADATA_KEY_URL,
- GRL_METADATA_KEY_CERTIFICATE,
- GRL_METADATA_KEY_STUDIO,
- GRL_METADATA_KEY_LICENSE,
- NULL);
- }
- return keys;
-}
-
-static void
-grl_apple_trailers_source_browse (GrlSource *source,
- GrlSourceBrowseSpec *bs)
-{
- GrlAppleTrailersSource *at_source = GRL_APPLE_TRAILERS_SOURCE (source);
- OperationData *op_data;
-
- GRL_DEBUG (__FUNCTION__);
-
- op_data = g_slice_new0 (OperationData);
- op_data->bs = bs;
- op_data->cancellable = g_cancellable_new();
- grl_operation_set_data (bs->operation_id, op_data);
-
- if (at_source->priv->hd) {
- read_url_async (at_source, APPLE_TRAILERS_CURRENT_HD, op_data);
- } else {
- read_url_async (at_source, APPLE_TRAILERS_CURRENT_SD, op_data);
- }
-}
-
-static void
-grl_apple_trailers_source_cancel (GrlSource *source, guint operation_id)
-{
- OperationData *op_data;
-
- GRL_DEBUG ("grl_apple_trailers_source_cancel");
-
- op_data = (OperationData *) grl_operation_get_data (operation_id);
- if (op_data) {
- g_cancellable_cancel (op_data->cancellable);
- }
-}
diff --git a/src/apple-trailers/grl-apple-trailers.h b/src/apple-trailers/grl-apple-trailers.h
deleted file mode 100644
index 874d648..0000000
--- a/src/apple-trailers/grl-apple-trailers.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2010 Igalia S.L.
- *
- * Contact: Iago Toral Quiroga <itoral@igalia.com>
- *
- * Authors: Juan A. Suarez Romero <jasuarez@igalia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef _GRL_APPLE_TRAILERS_SOURCE_H_
-#define _GRL_APPLE_TRAILERS_SOURCE_H_
-
-#include <grilo.h>
-
-#define GRL_APPLE_TRAILERS_SOURCE_TYPE \
- (grl_apple_trailers_source_get_type ())
-
-#define GRL_APPLE_TRAILERS_SOURCE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE, \
- GrlAppleTrailersSource))
-
-#define GRL_IS_APPLE_TRAILERS_SOURCE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE))
-
-#define GRL_APPLE_TRAILERS_SOURCE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE, \
- GrlAppleTrailersSourceClass))
-
-#define GRL_IS_APPLE_TRAILERS_SOURCE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE))
-
-#define GRL_APPLE_TRAILERS_SOURCE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS ((obj), \
- GRL_APPLE_TRAILERS_SOURCE_TYPE, \
- GrlAppleTrailersSourceClass))
-
-typedef struct _GrlAppleTrailersSource GrlAppleTrailersSource;
-typedef struct _GrlAppleTrailersSourcePriv GrlAppleTrailersSourcePriv;
-
-struct _GrlAppleTrailersSource {
-
- GrlSource parent;
-
- /*< private >*/
- GrlAppleTrailersSourcePriv *priv;
-
-};
-
-typedef struct _GrlAppleTrailersSourceClass GrlAppleTrailersSourceClass;
-
-struct _GrlAppleTrailersSourceClass {
-
- GrlSourceClass parent_class;
-
-};
-
-GType grl_apple_trailers_source_get_type (void);
-
-#endif /* _GRL_APPLE_TRAILERS_SOURCE_H_ */
diff --git a/src/apple-trailers/grl-apple-trailers.xml b/src/apple-trailers/grl-apple-trailers.xml
deleted file mode 100644
index cb9612d..0000000
--- a/src/apple-trailers/grl-apple-trailers.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<plugin>
- <info>
- <name>Apple Movie Trailers</name>
- <module>libgrlappletrailers</module>
- <description>A plugin for browsing Apple Movie Trailers</description>
- <author>Igalia S.L.</author>
- <license>LGPL</license>
- <site>http://www.igalia.com</site>
- </info>
-</plugin>
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ab4101e..1e0369d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -9,10 +9,6 @@ include $(top_srcdir)/gtester.mk
SUBDIRS =
-if APPLE_TRAILERS_PLUGIN
-SUBDIRS += apple-trailers
-endif
-
if BLIPTV_PLUGIN
SUBDIRS += bliptv
endif
@@ -46,7 +42,6 @@ SUBDIRS += vimeo
endif
DIST_SUBDIRS = \
- apple-trailers \
bliptv \
dleyna \
lastfm-albumart\
diff --git a/tests/apple-trailers/Makefile.am b/tests/apple-trailers/Makefile.am
deleted file mode 100644
index bb0ea87..0000000
--- a/tests/apple-trailers/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Makefile.am
-#
-# Author: Iago Toral <itoral@igalia.com>
-#
-# Copyright (C) 2013 Igalia S.L.
-
-include $(top_srcdir)/gtester.mk
-
-TEST_PROGS += \
- test_apple_trailers
-
-test_apple_trailers_defines = \
- -DAPPLE_TRAILERS_PLUGIN_PATH=\""$(abs_top_builddir)/src/apple-trailers/.libs/"\" \
- -DAPPLE_TRAILERS_DATA_PATH=\""$(abs_top_srcdir)/tests/apple-trailers/data/"\"
-
-test_apple_trailers_SOURCES = \
- test_apple_trailers.c
-
-test_apple_trailers_LDADD = \
- @DEPS_LIBS@
-
-test_apple_trailers_CFLAGS = \
- @DEPS_CFLAGS@ \
- $(test_apple_trailers_defines)
-
-# Distribute the tests data:
-dist_noinst_DATA = \
- data/network-data.ini \
- data/apple-trailers.data
-
-noinst_PROGRAMS = $(TEST_PROGS)
-
--include $(top_srcdir)/git.mk
diff --git a/tests/apple-trailers/data/apple-trailers.data b/tests/apple-trailers/data/apple-trailers.data
deleted file mode 100644
index b7ee457..0000000
--- a/tests/apple-trailers/data/apple-trailers.data
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<records date="Mon, 01 Jul 2013 01:00:31 -0700"><movieinfo id="7501"><info><title>2 Guns</title><runtime>3:05</runtime><rating>Not yet rated</rating><studio>Universal Pictures</studio><postdate>2013-03-29</postdate><releasedate>2013-08-02</releasedate><copyright>© Copyright 2013 Universal Pictures</copyright><director>Baltasar Kormákur</director><description>Academy Award(R) winner Denzel Washington and Mark Wahlberg lead an all-star cast in 2 Guns, an explosive action film that tracks two operatives from competing bureaus who are forced on the run together. But there is a big problem with their unique alliance: Neither knows that the other is an undercover federal agent. </description></info><cast><name>Denzel Washington</name><name>Mark Wahlberg</name><name>Paula Patton</name><name>Bill Paxton</name><name>Fred Ward</name><name>James Marsden</name><name>Edward James Olmos</name></cast><genre><name>Action and Adventure</name></genre><poster><location>http://trailers.apple.com/trailers/universal/2guns/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/universal/2guns/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="25519191">http://trailers.apple.com/movies/universal/2guns/2guns-tlr_h480p.mov</large></preview></movieinfo><movieinfo id="7863"><info><title>20 Feet from Stardom</title><runtime>2:13</runtime><rating>PG-13</rating><studio>RADiUS / TWC</studio><postdate>2013-05-01</postdate><releasedate>2013-06-14</releasedate><copyright>© Copyright 2013 RADiUS / TWC</copyright><director>Morgan Neville</director><description>Millions know their voices, but no one knows their names. In his compelling new film TWENTY FEET FROM STARDOM, award-winning director Morgan Neville shines a spotlight on the untold true story of the backup singers behind some of the greatest musical legends of the 21st century. Triumphant and heartbreaking in equal measure, the film is both a tribute to the unsung voices who brought shape and style to popular music and a reflection on the conflicts, sacrifices and rewards of a career spent harmonizing with others.</description></info><cast><name>Darlene Love</name><name>Merry Clayton</name><name>Lisa Fischer</name><name>Tata Vega</name><name>Judith Hill</name></cast><genre><name>Drama</name></genre><poster><location>http://trailers.apple.com/trailers/independent/twentyfeetfromstardom/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/independent/twentyfeetfromstardom/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="27263951">http://trailers.apple.com/movies/independent/20feetfromstardom/20feetfromstardom-tlr_h480p.mov</large></preview></movieinfo><movieinfo id="6466"><info><title>300: Rise of an Empire</title><runtime>2:30</runtime><rating>Not yet rated</rating><studio>Warner Bros. Pictures</studio><postdate>2013-06-21</postdate><releasedate>2014-03-07</releasedate><copyright>© Copyright 2014 Warner Bros. Pictures</copyright><director>Noam Murro</director><description>Based on Frank Miller’s latest graphic novel Xerxes and told in the breathtaking visual style of the blockbuster “300,” this new chapter of the epic saga takes the action to a fresh battlefield—on the sea—as Greek general Themistokles (Sullivan Stapleton) attempts to unite all of Greece by leading the charge that will change the course of the war. “300: Rise of an Empire” pits Themistokles against the massive invading Persian forces led by mortal-turned-god Xerxes (Rodrigo Santoro), and Artemesia (Eva Green), vengeful commander of the Persian navy.</description></info><cast><name>Sullivan Stapleton</name><name>Eva Green</name><name>Lena Headey</name><name>Hans Matheson</name><name>Rodrigo Santoro</name><name>David Wenham</name><name>Igal Nao</name><name>Callan Mulvey</name><name>Jack O'Connell</name><name>Andrew Tiernan</name></cast><genre><name>Action and Adventure</name></genre><poster><location>http://trailers.apple.com/trailers/wb/300riseofanempire/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/wb/300riseofanempire/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="19392254">http://trailers.apple.com/movies/wb/300riseofanempire/300riseofanempire-tlr1_h480p.mov</large></preview></movieinfo><movieinfo id="5583"><info><title>42</title><runtime>2:33</runtime><rating>PG-13</rating><studio>Warner Bros. Pictures</studio><postdate>2013-01-10</postdate><releasedate>2013-04-12</releasedate><copyright>© Copyright 2013 Warner Bros. Pictures</copyright><director>Brian Helgeland</director><description>Warner Bros. Pictures and Legendary Pictures are teaming up with director Brian Helgeland for “42,” the powerful story of Jackie Robinson, the legendary baseball player who broke Major League Baseball’s color barrier when he joined the roster of the Brooklyn Dodgers. “42” will star Academy Award(R) nominee Harrison Ford (“Witness”) as the innovative Dodger’s general manager Branch Rickey, the MLB executive who first signed Robinson to the minors and then helped to bring him up to the show, and Chadwick Boseman (“The Express”) as Robinson, the heroic African American who was the first man to break the color line in the big leagues.</description></info><cast><name>Harrison Ford</name><name>Christopher Meloni</name><name>Ryan Merriman</name><name>Brad Beyer</name><name>Judy Tylor</name><name>Jon Bernthal</name><name>Nicole Beharie</name><name>Chadwick Boseman</name><name>T.R. Knight</name></cast><genre><name>Drama</name></genre><poster><location>http://trailers.apple.com/trailers/wb/42/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/wb/42/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="46695833">http://trailers.apple.com/movies/wb/42/42-tlr2_h480p.mov</large></preview></movieinfo><movieinfo id="7746"><info><title>A Hijacking</title><runtime>1:28</runtime><rating>R</rating><studio>Magnolia Pictures</studio><postdate>2013-04-22</postdate><releasedate>2013-06-21</releasedate><copyright>© Copyright 2013 Magnolia Pictures</copyright><director>Tobias Lindholm</director><description>The cargo ship MV Rozen is heading for harbour when it is hijacked by Somali pirates in the Indian Ocean. Amongst the men on board are the ship’s cook Mikkel and the engineer Jan, who along with the rest of the seamen are taken hostage in a cynical game of life and death. With the demand for a ransom of millions of dollars a psychological drama unfolds between the CEO of the shipping company and the Somali pirates.</description></info><cast><name>Johan Philip Asbæk</name><name>Søren Malling</name><name>Dar Salim</name><name>Roland Møller</name><name>Gary Skjoldmose Porter</name><name>Abdihakin Asgar</name><name>Amalie Alstrup</name><name>Amalie Vulff Andersen</name><name>Linda Laursen</name><name>Keith Pearson</name></cast><genre><name>Drama</name></genre><poster><location>http://trailers.apple.com/trailers/magnolia/ahijacking/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/magnolia/ahijacking/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="24157601">http://trailers.apple.com/movies/magnolia_pictures/ahijacking/ahijacking-tlr_h480p.mov</large></preview></movieinfo><movieinfo id="8243"><info><title>About Time</title><runtime>2:30</runtime><rating>Not yet rated</rating><studio>Universal Pictures</studio><postdate>2013-05-21</postdate><releasedate>2013-11-01</releasedate><copyright>© Copyright 2013 Universal Pictures</copyright><director>Richard Curtis</director><description>The night after another unsatisfactory New Year party, Tim’s father (Bill Nighy) tells his son that the men in his family have always had the ability to travel through time. Tim can’t change history, but he can change what happens and has happened in his own life—so he decides to make his world a better place… by getting a girlfriend. Sadly, that turns out not to be as easy as you might think.</description></info><cast><name>Domhnall Gleeson</name><name>Rachel McAdams</name><name>Bill Nighy </name><name>Tom Hollander</name><name>Margot Robbie</name></cast><genre><name>Comedy</name></genre><poster><location>http://trailers.apple.com/trailers/universal/abouttime/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/universal/abouttime/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="20418329">http://trailers.apple.com/movies/universal/abouttime/abouttime-tlr1_h480p.mov</large></preview></movieinfo><movieinfo id="8661"><info><title>Adore</title><runtime>2:30</runtime><rating>R</rating><studio>Exclusive Media</studio><postdate>2013-06-24</postdate><releasedate>2013-09-06</releasedate><copyright>© Copyright 2013 Exclusive Media</copyright><director>Anne Fontaine</director><description>Naomi Watts and Robin Wright deliver riveting performances in ADORE, a sensual and provocative drama about two lifelong friends who find unexpected happiness in relationships that cross the bounds of convention. An unpredictable tale of misguided love and a heartfelt celebration of the enduring nature of female friendship, ADORE is the English-speaking directorial debut of Anne Fontaine. Set in an Australian seaside town, ADORE establishes an aura of fable as it follows two women’s plunge into uncharted waters. Watts and Wright fearlessly engage with the physical and psychological components of the story, capturing the complex emotions and powerful desires driving their characters. Strong performances from Xavier Samuel and James Frecheville complement Watts and Wright. ADORE radiates with intoxicating sensuality while exploring the intricacies of love, family, morality and passion.</description></info><cast><name>Naomi Watts</name><name>Robin Wright</name><name>Xavier Samuel</name><name>James Frechevile</name><name>Ben Mendelsohn</name></cast><genre><name>Drama</name></genre><poster><location>http://trailers.apple.com/trailers/independent/adore/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/independent/adore/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="20873720">http://trailers.apple.com/movies/independent/adore/adore-tlr1_h480p.mov</large></preview></movieinfo><movieinfo id="6402"><info><title>After Earth</title><runtime>2:31</runtime><rating>PG-13</rating><studio>Columbia Pictures</studio><postdate>2013-03-07</postdate><releasedate>2013-05-31</releasedate><copyright>© Copyright 2013 Columbia Pictures</copyright><director>M. Night Shyamalan</director><description>A crash landing leaves teenager Kitai Raige (Jaden Smith) and his legendary father Cypher (Will Smith) stranded on Earth, 1,000 years after cataclysmic events forced humanity’s escape. With Cypher critically injured, Kitai must embark on a perilous journey to signal for help, facing uncharted terrain, evolved animal species that now rule the planet, and an unstoppable alien creature that escaped during the crash. Father and son must learn to work together and trust one another if they want any chance of returning home.</description></info><cast><name>Jaden Smith</name><name>Will Smith</name></cast><genre><name>Science Fiction</name><name>Action and Adventure</name></genre><poster><location>http://trailers.apple.com/trailers/sony_pictures/afterearth/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/sony_pictures/afterearth/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="60882616">http://trailers.apple.com/movies/sony_pictures/afterearth/afterearth-tlr2_h480p.mov</large></preview></movieinfo><movieinfo id="8063"><info><title>Aftershock</title><runtime>2:25</runtime><rating>R</rating><studio>RADiUS / TWC</studio><postdate>2013-05-09</postdate><releasedate>2013-05-10</releasedate><copyright>© Copyright 2013 RADiUS / TWC</copyright><director>Nicolas Lopez</director><description>In the middle of a night of wild partying, a hapless American tourist (Hostel director Eli Roth) and his friends are suddenly plunged into a living hell when a powerful earthquake rips through the coastal town of Valparaíso, Chile.</description></info><cast><name>Eli Roth</name><name>Andrea Osvart</name><name>Ariel Levy</name><name>Natasha Yarovenko</name><name>Nicolas Martinez</name><name>Lorenza Izzo</name><name>Selena Gomez</name></cast><genre><name>Horror</name><name>Thriller</name></genre><poster><location>http://trailers.apple.com/trailers/independent/aftershock/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/independent/aftershock/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="17761014">http://trailers.apple.com/movies/weinstein/aftershock/aftershock-tlr1_h480p.mov</large></preview></movieinfo><movieinfo id="4997"><info><title>Anchorman 2</title><runtime>1:40</runtime><rating>Not yet rated</rating><studio>Paramount Pictures</studio><postdate>2013-06-21</postdate><releasedate/><copyright>© Copyright 1969 Paramount Pictures</copyright><director>Adam McKay</director><description>With the 70’s behind him, San Diego’s top rated newsman, Ron Burgundy (Will Ferrell), returns to the news desk in “Anchorman 2: The Legend Continues.” Also back for more are Ron’s co-anchor and wife, Veronica Corningstone (Christina Applegate), weather man Brick Tamland (Steve Carell), man on the street Brian Fantana (Paul Rudd) and sports guy Champ Kind (David Koechner) - All of whom won’t make it easy to stay classy…while taking New York’s first 24-hour news channel by storm. </description></info><cast><name>Will Ferrell</name><name>Steve Carell</name><name>Paul Rudd</name></cast><genre><name>Comedy</name></genre><poster><location>http://trailers.apple.com/trailers/paramount/anchorman2/images/poster.jpg</location><xlarge>http://trailers.apple.com/trailers/paramount/anchorman2/images/poster-xlarge.jpg</xlarge></poster><preview><large filesize="13783301">http://trailers.apple.com/movies/paramount/anchorman2/anchorman2-tlr3_h480p.mov</large></preview></movieinfo></records>
diff --git a/tests/apple-trailers/data/network-data.ini b/tests/apple-trailers/data/network-data.ini
deleted file mode 100644
index 1b16d53..0000000
--- a/tests/apple-trailers/data/network-data.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[default]
-version=1
-
-[http://trailers.apple.com/trailers/home/xml/current_480p.xml]
-data=apple-trailers.data
-
diff --git a/tests/apple-trailers/test_apple_trailers.c b/tests/apple-trailers/test_apple_trailers.c
deleted file mode 100644
index 6c6730f..0000000
--- a/tests/apple-trailers/test_apple_trailers.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (C) 2013 Igalia S.L.
- *
- * Author: Juan A. Suarez Romero <jasuarez@igalia.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <grilo.h>
-
-#define APPLE_TRAILERS_ID "grl-apple-trailers"
-
-static void
-test_setup (void)
-{
- GError *error = NULL;
- GrlRegistry *registry;
-
- registry = grl_registry_get_default ();
- grl_registry_load_all_plugins (registry, &error);
- g_assert_no_error (error);
-}
-
-static void
-verify (GrlData *data,
- guint n)
-{
- static GHashTable *expected[3] = { NULL };
- static gboolean initialized = FALSE;
-
- g_return_if_fail (n < 3);
-
- if (!initialized) {
- initialized = TRUE;
-
- expected[0] = g_hash_table_new (NULL, NULL);
- g_hash_table_insert (expected[0], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID), "7501");
- g_hash_table_insert (expected[0], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_TITLE), "2 Guns");
- g_hash_table_insert (expected[0], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DURATION), GINT_TO_POINTER (185));
-
- expected[1] = g_hash_table_new (NULL, NULL);
- g_hash_table_insert (expected[1], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID), "7863");
- g_hash_table_insert (expected[1], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_TITLE), "20 Feet from Stardom");
- g_hash_table_insert (expected[1], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DURATION), GINT_TO_POINTER (133));
-
- expected[2] = g_hash_table_new (NULL, NULL);
- g_hash_table_insert (expected[2], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID), "6466");
- g_hash_table_insert (expected[2], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_TITLE), "300: Rise of an Empire");
- g_hash_table_insert (expected[2], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DURATION), GINT_TO_POINTER (150));
- }
-
- g_assert_cmpstr (grl_data_get_string (data, GRL_METADATA_KEY_ID),
- ==,
- g_hash_table_lookup (expected[n], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_ID)));
- g_assert_cmpstr (grl_data_get_string (data, GRL_METADATA_KEY_TITLE),
- ==,
- g_hash_table_lookup (expected[n], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_TITLE)));
- g_assert_cmpint (grl_data_get_int (data, GRL_METADATA_KEY_DURATION),
- ==,
- GPOINTER_TO_INT (g_hash_table_lookup (expected[n], GRLKEYID_TO_POINTER (GRL_METADATA_KEY_DURATION))));
-}
-
-static void
-test_browse_count (void)
-{
- GError *error = NULL;
- GList *medias;
- GrlOperationOptions *options;
- GrlRegistry *registry;
- GrlSource *source;
-
- registry = grl_registry_get_default ();
- source = grl_registry_lookup_source (registry, "grl-apple-trailers");
- g_assert (source);
- options = grl_operation_options_new (NULL);
- grl_operation_options_set_count (options, 2);
- g_assert (options);
-
- medias = grl_source_browse_sync (source,
- NULL,
- grl_source_supported_keys (source),
- options,
- &error);
- g_assert_cmpint (g_list_length(medias), ==, 2);
- g_assert_no_error (error);
-
- verify (GRL_DATA (g_list_nth_data (medias, 0)), 0);
- verify (GRL_DATA (g_list_nth_data (medias, 1)), 1);
-
- g_list_free_full (medias, g_object_unref);
- g_object_unref (options);
-}
-
-static void
-test_browse_skip (void)
-{
- GError *error = NULL;
- GList *medias;
- GrlOperationOptions *options;
- GrlRegistry *registry;
- GrlSource *source;
-
- registry = grl_registry_get_default ();
- source = grl_registry_lookup_source (registry, "grl-apple-trailers");
- g_assert (source);
- options = grl_operation_options_new (NULL);
- grl_operation_options_set_count (options, 2);
- grl_operation_options_set_skip (options, 1);
- g_assert (options);
-
- medias = grl_source_browse_sync (source,
- NULL,
- grl_source_supported_keys (source),
- options,
- &error);
- g_assert_cmpint (g_list_length(medias), ==, 2);
- g_assert_no_error (error);
-
- verify (GRL_DATA (g_list_nth_data (medias, 0)), 1);
- verify (GRL_DATA (g_list_nth_data (medias, 1)), 2);
-
- g_list_free_full (medias, g_object_unref);
- g_object_unref (options);
-}
-
-int
-main(int argc, char **argv)
-{
- g_setenv ("GRL_PLUGIN_PATH", APPLE_TRAILERS_PLUGIN_PATH, TRUE);
- g_setenv ("GRL_PLUGIN_LIST", APPLE_TRAILERS_ID, TRUE);
- g_setenv ("GRL_NET_MOCKED", APPLE_TRAILERS_DATA_PATH "network-data.ini", TRUE);
-
- grl_init (&argc, &argv);
- g_test_init (&argc, &argv, NULL);
-
-#if !GLIB_CHECK_VERSION(2,32,0)
- g_thread_init (NULL);
-#endif
-
- test_setup ();
-
- g_test_add_func ("/apple-trailers/browse/count", test_browse_count);
- g_test_add_func ("/apple-trailers/browse/skip", test_browse_skip);
-
- gint result = g_test_run ();
-
- grl_deinit ();
-
- return result;
-}