From 97191f5ae08ffdcc3fd0113691fc435519fccbc7 Mon Sep 17 00:00:00 2001 From: Jens Georg Date: Sun, 18 Mar 2012 22:02:10 +0100 Subject: [PATCH] core: Set X_DLNACAP according to configuration https://bugzilla.gnome.org/show_bug.cgi?id=667781 --- src/rygel/rygel-root-device-factory.vala | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/rygel/rygel-root-device-factory.vala b/src/rygel/rygel-root-device-factory.vala index 982ab75..bb73ee6 100644 --- a/src/rygel/rygel-root-device-factory.vala +++ b/src/rygel/rygel-root-device-factory.vala @@ -116,6 +116,7 @@ internal class Rygel.RootDeviceFactory { this.set_friendly_name_and_udn (device_element, plugin.name, plugin.title); + this.set_dlnacap (device_element); if (plugin.description != null) { this.set_description (device_element, plugin.description); @@ -175,6 +176,30 @@ internal class Rygel.RootDeviceFactory { } } + private void set_dlnacap (Xml.Node *device_element) { + var element = XMLUtils.get_element (device_element, + "X_DLNACAP", + null); + + var content = ""; + var allow_upload = true; + var allow_delete = false; + + try { + allow_upload = config.get_allow_upload (); + allow_delete = config.get_allow_deletion (); + } catch (Error error) { } + + if (allow_upload) { + content += "av-upload,image-upload,audio-upload"; + } + + if (allow_delete) { + content += ",create-item-with-OCM-destroy-item"; + } + element->set_content (content); + } + private void set_description (Xml.Node *device_element, string description) { Xml.Node *element = XMLUtils.get_element (device_element, -- 2.7.4