summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2016-05-21 12:42:05 +0200
committerJens Georg <mail@jensge.org>2016-05-21 13:11:40 +0200
commit6d71bc32f1905b047825c463389054b95457588e (patch)
tree4ac316e2e2dd622272301e6087022eb756fc57ad
parent1832c6c6c4fdc85d336823849ff7884a9f3bd72b (diff)
downloadrygel-6d71bc32f1905b047825c463389054b95457588e.tar.gz
mediathek: Remove plugin
The RSS items don't work anymore, always return 404. Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r--README1
-rwxr-xr-xautogen.sh2
-rw-r--r--configure.ac11
-rw-r--r--data/rygel.conf6
-rw-r--r--doc/Makefile.am3
-rw-r--r--doc/README.Mediathek21
-rw-r--r--doc/man/rygel.conf.xml27
-rw-r--r--po/POTFILES.skip16
-rwxr-xr-xpo/gen-potfiles-skip1
-rw-r--r--src/plugins/Makefile.am5
-rw-r--r--src/plugins/mediathek/Makefile.am30
-rw-r--r--src/plugins/mediathek/mediathek.plugin.in7
-rw-r--r--src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.vala105
-rw-r--r--src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.vala56
-rw-r--r--src/plugins/mediathek/rygel-mediathek-playlist-parser.vala55
-rw-r--r--src/plugins/mediathek/rygel-mediathek-plugin.vala46
-rw-r--r--src/plugins/mediathek/rygel-mediathek-root-container.vala93
-rw-r--r--src/plugins/mediathek/rygel-mediathek-rss-container.vala142
-rw-r--r--src/plugins/mediathek/rygel-mediathek-soup-utils.vala31
-rw-r--r--src/plugins/mediathek/rygel-mediathek-video-item-factory.vala165
20 files changed, 3 insertions, 820 deletions
diff --git a/README b/README
index a653ea45..3205631a 100644
--- a/README
+++ b/README
@@ -83,7 +83,6 @@ References
* http://www.upnp.org/specs/av/UPnP-av-MediaServer-v2-Device-20060531.pdf
* https://wiki.gnome.org/Projects/Tracker
* https://wiki.gnome.org/Projects/DVBDaemon
- * http://www.zdf.de
* https://wiki.gnome.org/Projects/Rygel/MediaServer2Spec
* http://www.mpris.org/2.0/spec/
diff --git a/autogen.sh b/autogen.sh
index aaa3abfa..4b79ff60 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
-DEFAULT_ARGS="--enable-vala --enable-maintainer-mode --enable-debug --enable-example-plugins --enable-mediathek-plugin --enable-gst-launch-plugin --disable-strict-valac"
+DEFAULT_ARGS="--enable-vala --enable-maintainer-mode --enable-debug --enable-example-plugins --enable-gst-launch-plugin --disable-strict-valac"
mkdir -p m4
diff --git a/configure.ac b/configure.ac
index 88fba8ce..4f6327cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -220,16 +220,6 @@ AS_IF([test "x$enable_mpris_plugin" = "xyes"],
PKG_CHECK_MODULES([RYGEL_PLUGIN_MPRIS_DEPS], [$RYGEL_COMMON_MODULES gio-2.0 >= $GIO_REQUIRED])
])
-RYGEL_ADD_PLUGIN([mediathek],[ZDF Mediathek],[no])
-AS_IF([test "x$enable_mediathek_plugin" = "xyes"],
- [
- PKG_CHECK_MODULES([RYGEL_PLUGIN_MEDIATHEK_DEPS],
- [$RYGEL_COMMON_MODULES
- gio-2.0 >= $GIO_REQUIRED
- libsoup-2.4 >= $LIBSOUP_REQUIRED
- libxml-2.0 >= $LIBXML_REQUIRED])
- ])
-
RYGEL_ADD_PLUGIN([ruih],[Ruih],[yes])
AS_IF([test "x$enable_ruih_plugin" = "xyes"],
[
@@ -582,7 +572,6 @@ echo "
examples: ${enable_example_plugins}
tracker: ${enable_tracker_plugin}
version: ${tracker_api_version}
- mediathek: ${enable_mediathek_plugin}
media-export ${enable_media_export_plugin}
lightmediascanner ${enable_lms_plugin}
external: ${enable_external_plugin}
diff --git a/data/rygel.conf b/data/rygel.conf
index 6325d720..87dd4087 100644
--- a/data/rygel.conf
+++ b/data/rygel.conf
@@ -123,12 +123,6 @@ virtual-folders=true
enabled=true
title=Audio/Video playback on @PRETTY_HOSTNAME@
-[ZDFMediathek]
-enabled=false
-# List of ids of broadcasts
-rss=1901618
-update-interval=1800
-
[GstLaunch]
enabled=false
launch-items=audiotestsrc;videotestsrc;videotestoverlay
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8e84ab08..35d763e8 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -8,8 +8,7 @@ dist_man5_MANS = \
EXTRA_DIST = \
man/rygel.xml \
- man/rygel.conf.xml \
- README.Mediathek
+ man/rygel.conf.xml
if HAVE_XSLTPROC
%.5 %.1: man/%.xml
diff --git a/doc/README.Mediathek b/doc/README.Mediathek
deleted file mode 100644
index a0c2aa33..00000000
--- a/doc/README.Mediathek
+++ /dev/null
@@ -1,21 +0,0 @@
-Konfiguration des Mediathekplugins
-===================================
-
-Das Mediathekplugin bietet eine Möglichkeit, bequem Sendungen aus der ZDF
-Mediathek anzuschauen.
-
-Im Moment werden nur die RSS-Feeds unterstützt. Die zu abbonierenden RSS-Feeds
-werden in der Konfiguationstadatei im Abschnitt [ZDFMediathek] unter dem
-Schlüssel "rss" mit Semikolon getrennt eingetragen. Er enthält die
-"Contentidentifier" der Sendungen oder Kategorien. Diese kann man am
-einfachsten über die Seite
-
-http://www.zdf.de/ZDFmediathek/kanaluebersicht/884708/rubrik/Film?flash=off
-
-in Erfahrung bringen, indem man sich die entsprechende Sendung oder
-Themengruppe heraussucht und bis zum Abschnitt "RSS" scrollt. Für das Magazin
-"aspekte" steht dann dort z.B. folgende URL:
-
- http://www.zdf.de/ZDFmediathek/content/500?view=rss
-
-Die Content-ID wäre in diesem Fall 500.
diff --git a/doc/man/rygel.conf.xml b/doc/man/rygel.conf.xml
index d77beefc..649d90ec 100644
--- a/doc/man/rygel.conf.xml
+++ b/doc/man/rygel.conf.xml
@@ -444,31 +444,6 @@ man(1), man(7), http://www.tldp.org/HOWTO/Man-Page/
<para>This plugin has no special options.</para>
</refsect1>
<refsect1>
- <title>ZDFMediathek</title>
- <para>The <ulink url="http://www.zdf.de/ZDFmediathek">ZDF Mediathek</ulink> is an online archive of broadcasts from the second german television. This plugin can be used to subscribes to the RSS feeds of this service and expose the broadcasts via UPnP.</para>
- <para><note>
- <para>The support for the WMV streaming format was removed from the server, only RTSP support remains. Rygel has issues proxying this via HTTP so your client has to support RTSP in order to be able to view the streams without transcoding.</para>
- </note></para>
- <variablelist>
- <varlistentry>
- <term>
- <option>rss</option>
- </term>
- <listitem>
- <para>A list of broadcast ids. How to get the broadcast ids from the web site is described in the file <filename>README.Mediathek</filename> (in german only).</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <option>update-interval</option>
- </term>
- <listitem>
- <para>Time in seconds after which the plugin checks for new content. The default interval is 1800 seconds (30 minutes), the minimum interval 10 minutes.</para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
<title>LightMediaScanner Plugin</title>
<para>The LightMediaScanner plugin exports the contents of the <ulink url="https://github.com/profusion/lightmediascanner">lightmediascanner daemon</ulink> </para>
<para>This plugin does not have any special options.</para>
@@ -551,7 +526,7 @@ title=@REALNAME@&apos;s Banshee on @HOSTNAME@</programlisting></para>
<!-- In alpabetical order. --> <para><citerefentry>
<refentrytitle>rygel</refentrytitle>
<manvolnum>1</manvolnum>
- </citerefentry>, <filename>README.Mediathek</filename>, <citerefentry>
+ </citerefentry>, <citerefentry>
<refentrytitle>gst-launch</refentrytitle>
<manvolnum>1</manvolnum>
</citerefentry></para>
diff --git a/po/POTFILES.skip b/po/POTFILES.skip
index 078a80ca..0f6decd0 100644
--- a/po/POTFILES.skip
+++ b/po/POTFILES.skip
@@ -213,22 +213,6 @@ src/plugins/media-export/rygel-media-export-trackable-db-container.c
src/plugins/media-export/rygel-media-export-updatable-object.c
src/plugins/media-export/rygel-media-export-video-item.c
src/plugins/media-export/rygel-media-export-writable-db-container.c
-src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.c
-src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.vala
-src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.c
-src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.vala
-src/plugins/mediathek/rygel-mediathek-playlist-parser.c
-src/plugins/mediathek/rygel-mediathek-playlist-parser.vala
-src/plugins/mediathek/rygel-mediathek-plugin.c
-src/plugins/mediathek/rygel-mediathek-plugin.vala
-src/plugins/mediathek/rygel-mediathek-root-container.c
-src/plugins/mediathek/rygel-mediathek-root-container.vala
-src/plugins/mediathek/rygel-mediathek-rss-container.c
-src/plugins/mediathek/rygel-mediathek-rss-container.vala
-src/plugins/mediathek/rygel-mediathek-soup-utils.c
-src/plugins/mediathek/rygel-mediathek-soup-utils.vala
-src/plugins/mediathek/rygel-mediathek-video-item-factory.c
-src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
src/plugins/mpris/rygel-mpris-interfaces.c
src/plugins/mpris/rygel-mpris-player.c
src/plugins/mpris/rygel-mpris-plugin.c
diff --git a/po/gen-potfiles-skip b/po/gen-potfiles-skip
index a1c9bc51..dccbf75b 100755
--- a/po/gen-potfiles-skip
+++ b/po/gen-potfiles-skip
@@ -12,6 +12,5 @@ data/xml/RenderingControl2.xml
__EOF__
) > POTFILES.skip
-(cd .. && find src/plugins/mediathek -name "*.vala" | sort) >> POTFILES.skip
(cd .. && find src -name "*.c" | sort ) >> POTFILES.skip
(cd .. && find tests -name "*.c" | sort ) >> POTFILES.skip
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 40791f05..cae36a92 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -2,10 +2,6 @@ if BUILD_TRACKER_PLUGIN
TRACKER_PLUGIN = tracker
endif
-if BUILD_MEDIATHEK_PLUGIN
-MEDIATHEK_PLUGIN = mediathek
-endif
-
if BUILD_MEDIA_EXPORT_PLUGIN
MEDIA_EXPORT_PLUGIN = media-export
endif
@@ -35,7 +31,6 @@ RUIH = ruih
endif
SUBDIRS = $(TRACKER_PLUGIN) \
- $(MEDIATHEK_PLUGIN) \
$(MEDIA_EXPORT_PLUGIN) \
$(LMS_PLUGIN) \
$(EXTERNAL_PLUGIN) \
diff --git a/src/plugins/mediathek/Makefile.am b/src/plugins/mediathek/Makefile.am
deleted file mode 100644
index 54758972..00000000
--- a/src/plugins/mediathek/Makefile.am
+++ /dev/null
@@ -1,30 +0,0 @@
-include $(top_srcdir)/common.am
-
-plugin_LTLIBRARIES = librygel-mediathek.la
-plugin_DATA = mediathek.plugin
-
-librygel_mediathek_la_SOURCES = \
- rygel-mediathek-asx-playlist-parser.vala \
- rygel-mediathek-mov-playlist-parser.vala \
- rygel-mediathek-plugin.vala \
- rygel-mediathek-playlist-parser.vala \
- rygel-mediathek-video-item-factory.vala \
- rygel-mediathek-root-container.vala \
- rygel-mediathek-rss-container.vala \
- rygel-mediathek-soup-utils.vala
-
-librygel_mediathek_la_VALAFLAGS = \
- $(RYGEL_COMMON_LIBRYGEL_SERVER_VALAFLAGS) \
- $(RYGEL_COMMON_VALAFLAGS)
-librygel_mediathek_la_CFLAGS = \
- $(RYGEL_PLUGIN_MEDIATHEK_DEPS_CFLAGS) \
- $(RYGEL_COMMON_LIBRYGEL_SERVER_CFLAGS) \
- $(RYGEL_COMMON_DEFINES_CFLAGS) \
- -DG_LOG_DOMAIN='"Mediathek"'
-librygel_mediathek_la_LIBADD = \
- $(RYGEL_PLUGIN_MEDIATHEK_DEPS_LIBS) \
- $(RYGEL_COMMON_LIBRYGEL_SERVER_LIBS)
-librygel_mediathek_la_LDFLAGS = \
- $(RYGEL_PLUGIN_LINKER_FLAGS)
-
-EXTRA_DIST = mediathek.plugin.in
diff --git a/src/plugins/mediathek/mediathek.plugin.in b/src/plugins/mediathek/mediathek.plugin.in
deleted file mode 100644
index caf1f4fb..00000000
--- a/src/plugins/mediathek/mediathek.plugin.in
+++ /dev/null
@@ -1,7 +0,0 @@
-[Plugin]
-Version = @VERSION@
-Module = mediathek
-Name = ZDFMediathek
-License = LGPL
-Description = Share videos from ZDF online services
-Copyright = Copyright © Rygel maintainers
diff --git a/src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.vala b/src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.vala
deleted file mode 100644
index c6ccf513..00000000
--- a/src/plugins/mediathek/rygel-mediathek-asx-playlist-parser.vala
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2009-2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Gee;
-using Soup;
-using Xml;
-
-/**
- * This class is a simple ASX playlist parser
- *
- * It does nothing but extracting all href tags from an ASX
- * and ignore all of the other information that may be in it
- *
- * This parser is //only// intended to work with the simple
- * ASX files presented by the ZDF Mediathek streaming server
- */
-internal class Rygel.Mediathek.AsxPlaylistParser : PlaylistParser {
- private Regex normalizer;
-
- public AsxPlaylistParser (Session session) {
- Object (session : session,
- playlist_suffix : ".asx",
- mime_type : "video/x-ms-wmv");
- try {
- this.normalizer = new Regex ("(<[/]?)([a-zA-Z:]+)");
- } catch (RegexError error) {};
- }
-
- /**
- * Get and parse the ASX file.
- *
- * This will fetch the ASX file using the soup session configured on
- * configure time.As ASX seems to be a bit inconsistent with regard to tag
- * case, all the tags are converted to lowercase. A XPath query is then used
- * to extract all of the href attributes for every entry in the file.
- *
- * @param uri network location of the ASX file
- * @return a list of uris found in this file
- */
- public override Gee.List<string>? parse_playlist (string data,
- int length)
- throws VideoItemError {
- ArrayList<string> uris = null;
-
- try {
- // lowercase all tags using regex and \L\E syntax
- var normalized_content = this.normalizer.replace
- (data,
- length,
- 0,
- "\\1\\L\\2\\E");
-
- var doc = Parser.parse_memory (normalized_content,
- (int) normalized_content.length);
- if (doc == null) {
- throw new VideoItemError.XML_PARSE_ERROR
- ("Could not parse playlist");
- }
-
- var doc_guard = new GUPnP.XMLDoc (doc);
- var context = new XPath.Context (doc_guard.doc);
-
- var xpath_object = context.eval ("/asx/entry/ref/@href");
-
- if (xpath_object->type != XPath.ObjectType.NODESET) {
- xpath_free_object (xpath_object);
- throw new VideoItemError.XML_PARSE_ERROR
- ("No uris found in playlist");
- }
-
- uris = new ArrayList<string> ();
- for (int i = 0;
- i < xpath_object->nodesetval->length ();
- i++) {
- var item = xpath_object->nodesetval->item (i);
- uris.add (item->children->content);
- }
-
- xpath_free_object (xpath_object);
- } catch (RegexError error) {
- throw new VideoItemError.XML_PARSE_ERROR ("Failed to normalize");
- }
-
- return uris;
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.vala b/src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.vala
deleted file mode 100644
index 31d2d4e6..00000000
--- a/src/plugins/mediathek/rygel-mediathek-mov-playlist-parser.vala
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Gee;
-using Soup;
-
-internal class Rygel.Mediathek.MovPlaylistParser : PlaylistParser {
- public MovPlaylistParser (Session session) {
- Object (session : session,
- playlist_suffix : ".mov",
- mime_type : "video/mp4");
- }
-
- public override Gee.List<string>? parse_playlist (string data,
- int length)
- throws VideoItemError {
- var lines = data.split ("\n");
- if (lines.length < 2) {
- throw new VideoItemError.XML_PARSE_ERROR
- ("Not enough entries in playlist");
- }
-
- if (lines[0] != "RTSPtext") {
- throw new VideoItemError.XML_PARSE_ERROR ("Invalid playlist format");
- }
-
- if (!lines[1].has_prefix ("rtsp")) {
- throw new VideoItemError.XML_PARSE_ERROR
- ("No rtsp url found in playlist");
- }
-
- var list = new ArrayList<string> ();
- list.add (lines[1]);
-
- return list;
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-playlist-parser.vala b/src/plugins/mediathek/rygel-mediathek-playlist-parser.vala
deleted file mode 100644
index cfd350c0..00000000
--- a/src/plugins/mediathek/rygel-mediathek-playlist-parser.vala
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Soup;
-using Gee;
-
-internal abstract class Rygel.Mediathek.PlaylistParser : Object {
- public Session session { get; construct; }
- public string playlist_suffix { get; construct; }
- public string mime_type { get; construct; }
-
- public async Gee.List<string>? parse (string uri) throws VideoItemError {
- var message = new Soup.Message ("GET", uri);
-
- // FIXME: Revert to SoupUtils once bgo#639702 is fixed
- SourceFunc callback = parse.callback;
- this.session.queue_message (message, () => { callback (); });
- yield;
-
- if (message.status_code != 200) {
- throw new VideoItemError.NETWORK_ERROR
- ("Playlist download failed: %u (%s)",
- message.status_code,
- Status.get_phrase
- (message.status_code));
- }
-
- return this.parse_playlist ((string) message.response_body.data,
- (int) message.response_body.length);
- }
-
-
- public abstract Gee.List<string>? parse_playlist (string data,
- int length)
- throws VideoItemError;
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-plugin.vala b/src/plugins/mediathek/rygel-mediathek-plugin.vala
deleted file mode 100644
index 7ec51011..00000000
--- a/src/plugins/mediathek/rygel-mediathek-plugin.vala
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2009 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Rygel;
-using GUPnP;
-
-// remove when bgo#639700 is fixed and "delete" resolves to the free_func and
-// not to g_free
-[CCode (cname = "xmlXPathFreeObject")]
-internal extern void xpath_free_object (Xml.XPath.Object *object);
-
-public void module_init (PluginLoader loader) {
- var plugin = new Mediathek.Plugin ();
-
- loader.add_plugin (plugin);
-}
-
-public class Rygel.Mediathek.Plugin : Rygel.MediaServerPlugin {
- public const string NAME = "ZDFMediathek";
-
- public Plugin () {
- base (RootContainer.get_instance (),
- Plugin.NAME,
- null,
- PluginCapabilities.TRACK_CHANGES);
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-root-container.vala b/src/plugins/mediathek/rygel-mediathek-root-container.vala
deleted file mode 100644
index 238c4ffd..00000000
--- a/src/plugins/mediathek/rygel-mediathek-root-container.vala
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009-2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Gee;
-using Soup;
-
-public class Rygel.Mediathek.RootContainer : Rygel.TrackableContainer,
- Rygel.SimpleContainer {
- private Session session;
- private static RootContainer instance;
- private static int DEFAULT_UPDATE_INTERVAL = 1800;
-
- public static RootContainer get_instance () {
- if (RootContainer.instance == null) {
- RootContainer.instance = new RootContainer ();
- RootContainer.instance.init.begin ();
- }
-
- return instance;
- }
-
- public static Session get_default_session () {
- return get_instance ().session;
- }
-
- private RootContainer () {
- base.root ("ZDF Mediathek");
- this.session = new Soup.Session ();
- }
-
- private async void init () {
- Gee.ArrayList<int> feeds = null;
- int update_interval = DEFAULT_UPDATE_INTERVAL;
-
- var config = Rygel.MetaConfig.get_default ();
- try {
- feeds = config.get_int_list ("ZDFMediathek", "rss");
- } catch (Error error) {
- feeds = new Gee.ArrayList<int> ();
- }
-
- if (feeds.size == 0) {
- message ("Could not get RSS from configuration, using defaults");
- feeds.add (508);
- }
-
- try {
- update_interval = config.get_int ("ZDFMediathek",
- "update-interval",
- 600,
- int.MAX);
- } catch (Error error) {
- update_interval = DEFAULT_UPDATE_INTERVAL;
- }
-
- foreach (int id in feeds) {
- yield this.add_child_tracked (new RssContainer (this, id));
- }
-
- Timeout.add_seconds (update_interval, () => {
- foreach (var child in this.children) {
- var container = child as RssContainer;
-
- container.update.begin ();
- }
-
- return true;
- });
- }
-
- public async void add_child (MediaObject object) {
- this.add_child_container (object as MediaContainer);
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-rss-container.vala b/src/plugins/mediathek/rygel-mediathek-rss-container.vala
deleted file mode 100644
index bd8a30ec..00000000
--- a/src/plugins/mediathek/rygel-mediathek-rss-container.vala
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright (C) 2009-2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-using Gee;
-using Soup;
-using Xml;
-
-public class Rygel.Mediathek.RssContainer : Rygel.TrackableContainer,
- Rygel.SimpleContainer {
- private const string URI_TEMPLATE = "http://www.zdf.de/ZDFmediathek/" +
- "content/%u?view=rss";
- private uint content_id;
- private Soup.Date last_modified = null;
- private string feed_uri;
-
- public RssContainer (MediaContainer parent, uint id) {
- base ("GroupId:%u".printf(id),
- parent,
- "ZDF Mediathek RSS feed %u".printf (id));
-
- this.content_id = id;
- this.feed_uri = URI_TEMPLATE.printf (id);
- this.sort_criteria = "-dc:date,+dc:title";
- this.update.begin ();
- }
-
- public async void update () {
- var message = this.get_update_message ();
-
- // FIXME: Revert to SoupUtils once bgo#639702 is fixed
- var session = RootContainer.get_default_session ();
- SourceFunc callback = update.callback;
- session.queue_message (message, () => { callback (); });
- yield;
-
- switch (message.status_code) {
- case 304:
- debug ("Feed at %s did not change, nothing to do.",
- message.uri.to_string (false));
- break;
- case 200:
- var success = yield this.parse_response (message);
- if (success) {
- var date = message.response_headers.get_one ("Date");
-
- this.last_modified = new Soup.Date.from_string (date);
- }
- break;
- default:
- warning ("Unexpected response %u for %s: %s",
- message.status_code,
- message.uri.to_string (false),
- Soup.Status.get_phrase (message.status_code));
- break;
- }
- }
-
- private async bool parse_response (Message message) {
- var factory = VideoItemFactory.get_default ();
- unowned MessageBody response = message.response_body;
-
- var doc = Xml.Parser.parse_memory ((string) response.data,
- (int) response.length);
- if (doc == null) {
- warning ("Failed to parse XML document");
-
- return false;
- }
- var guard = new GUPnP.XMLDoc (doc);
- var context = new XPath.Context (guard.doc);
-
- var xpath_object = context.eval ("/rss/channel/title");
- if (xpath_object->type == XPath.ObjectType.NODESET &&
- xpath_object->nodesetval->length () > 0) {
- // just use first title (there should be only one)
- this.title = xpath_object->nodesetval->item (0)->get_content ();
- }
- xpath_free_object (xpath_object);
-
- xpath_object = context.eval ("/rss/channel/item");
- if (xpath_object->type != XPath.ObjectType.NODESET) {
- xpath_free_object (xpath_object);
- warning ("RSS feed doesn't have items");
-
- return false;
- }
-
- yield this.clear ();
- this.child_count = 0;
- for (int i = 0; i < xpath_object->nodesetval->length (); i++) {
- var node = xpath_object->nodesetval->item (i);
- try {
- var item = yield factory.create (this, node);
- if (item != null) {
- yield this.add_child_tracked (item);
- }
- } catch (VideoItemError error) {
- debug ("Could not create video item: %s, skipping",
- error.message);
- }
- }
-
- xpath_free_object (xpath_object);
-
- return this.child_count > 0;
- }
-
- private Message get_update_message () {
- var message = new Soup.Message ("GET", this.feed_uri);
- if (this.last_modified != null) {
- var datestring = this.last_modified.to_string (DateFormat.HTTP);
-
- debug ("Requesting change since %s", datestring);
- message.request_headers.append("If-Modified-Since", datestring);
- }
-
- return message;
- }
-
- public async void add_child (MediaObject object) {
- this.add_child_item (object as MediaItem);
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-soup-utils.vala b/src/plugins/mediathek/rygel-mediathek-soup-utils.vala
deleted file mode 100644
index edc747b9..00000000
--- a/src/plugins/mediathek/rygel-mediathek-soup-utils.vala
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-internal class Rygel.Mediathek.SoupUtils : Object {
- public static async void queue_message (Soup.Session session,
- Soup.Message message) {
- SourceFunc asyc_callback = queue_message.callback;
-
- session.queue_message (message, () => { asyc_callback (); });
- yield;
- }
-}
diff --git a/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala b/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
deleted file mode 100644
index 03e6a83f..00000000
--- a/src/plugins/mediathek/rygel-mediathek-video-item-factory.vala
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2011 Jens Georg
- *
- * Author: Jens Georg <mail@jensge.org>
- *
- * This file is part of Rygel.
- *
- * Rygel 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; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Rygel 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-internal errordomain Rygel.Mediathek.VideoItemError {
- XML_PARSE_ERROR,
- NETWORK_ERROR
-}
-
-internal class Rygel.Mediathek.VideoItem : Rygel.TrackableItem,
- Rygel.VideoItem {
- public VideoItem (string id, MediaContainer parent, string title) {
- base (id, parent, title);
- }
-}
-
-internal class Rygel.Mediathek.VideoItemFactory : Object {
- private static VideoItemFactory instance;
- private PlaylistParser playlist_parser;
- private const string VIDEO_FORMAT_WMV = "wmv";
- private const string VIDEO_FORMAT_MP4 = "mp4";
- private string video_format;
-
- public static VideoItemFactory get_default () {
- if (instance == null) {
- instance = new VideoItemFactory ();
- }
-
- return instance;
- }
-
- public async VideoItem? create (MediaContainer parent,
- Xml.Node *xml_item)
- throws VideoItemError {
- string title, playlist_url, date, description = null;
-
- this.extract_data_from_xml (xml_item,
- out title,
- out playlist_url,
- out date,
- out description);
-
- var resolved_uris = yield playlist_parser.parse (playlist_url);
-
- if (resolved_uris == null || resolved_uris.size == 0) {
- return null;
- }
-
- var id = Checksum.compute_for_string (ChecksumType.MD5, title);
- var item = new VideoItem (id, parent, title);
-
- item.mime_type = this.playlist_parser.mime_type;
- item.author = "ZDF - Second German TV Channel Streams";
- item.date = date;
- item.description = description;
-
- if (this.video_format == VIDEO_FORMAT_WMV) {
- item.dlna_profile = "WMVMED_FULL";
- }
-
- foreach (var uri in resolved_uris) {
- item.add_uri (uri);
- }
-
- yield item.add_engine_resources ();
-
- return item;
- }
-
- private VideoItemFactory () {
- this.video_format = VIDEO_FORMAT_MP4;
-
- debug ("Exposing mediathek items in format: mp4");
- var session = RootContainer.get_default_session ();
-
- this.playlist_parser = new MovPlaylistParser (session);
- }
-
- private bool namespace_ok (Xml.Node* node, string prefix = "media") {
- return node->ns != null && node->ns->prefix == prefix;
- }
-
- private void extract_data_from_xml (Xml.Node *item,
- out string title,
- out string playlist_url,
- out string? date,
- out string? description)
- throws VideoItemError {
- var title_node = XMLUtils.get_element (item, "title");
- var group = XMLUtils.get_element (item, "group");
- playlist_url = null;
-
- if (title_node == null) {
- throw new VideoItemError.XML_PARSE_ERROR ("No 'title' element");
- }
-
- if (group == null) {
- throw new VideoItemError.XML_PARSE_ERROR ("No 'group' element");
- }
-
- if (!namespace_ok (group)) {
- throw new VideoItemError.XML_PARSE_ERROR ("Invalid namespace");
- }
-
- var content = XMLUtils.get_element (group, "content");
- if (content == null) {
- throw new VideoItemError.XML_PARSE_ERROR
- ("'group' has no 'content' element");
- }
-
- // content points to the first content subnode now
- while (content != null) {
- var url_attribute = content->has_prop ("url");
- if (url_attribute != null && namespace_ok (content)) {
-
- unowned string url = url_attribute->children->content;
- if (url.has_suffix (this.playlist_parser.playlist_suffix)) {
- playlist_url = url;
-
- break;
- }
-
- }
- content = content->next;
- }
-
- if (playlist_url == null) {
- throw new VideoItemError.XML_PARSE_ERROR ("No URL found");
- }
-
- title = title_node->get_content ();
-
- var date_node = XMLUtils.get_element (item, "date");
- if (date_node != null && this.namespace_ok (date_node, "dc")) {
- date = date_node->get_content ();
- } else {
- date = null;
- }
-
- var desc_node = XMLUtils.get_element (item, "description");
- if (desc_node != null) {
- description = desc_node->get_content ();
- } else {
- description = null;
- }
- }
-}