From c684b6ac4572187e01ba0742c5a3fe0e7194cc93 Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Tue, 26 Jan 2010 17:03:15 +0200 Subject: [PATCH] core: Support for 'place holder' items Items could be marked as 'place holder'. It means items that do not yet have any media (empty) available for them. --- src/rygel/rygel-didl-lite-writer.vala | 15 ++++++++++----- src/rygel/rygel-media-item.vala | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/rygel/rygel-didl-lite-writer.vala b/src/rygel/rygel-didl-lite-writer.vala index 3f3c949..7e5e7dc 100644 --- a/src/rygel/rygel-didl-lite-writer.vala +++ b/src/rygel/rygel-didl-lite-writer.vala @@ -85,13 +85,18 @@ internal class Rygel.DIDLLiteWriter : GUPnP.DIDLLiteWriter { didl_item.date = item.date; } - // Add the transcoded/proxy URIs first - this.http_server.add_resources (didl_item, item); + if (item.place_holder) { + this.http_server.add_proxy_resource (didl_item, item); + } else { + // Add the transcoded/proxy URIs first + this.http_server.add_resources (didl_item, item); - var internal_allowed = this.http_server.context.interface == "lo" || + // then original URIs + bool internal_allowed; + internal_allowed = this.http_server.context.interface == "lo" || this.http_server.context.host_ip == "127.0.0.1"; - // then original URIs - item.add_resources (didl_item, internal_allowed); + item.add_resources (didl_item, internal_allowed); + } } private void serialize_container (MediaContainer container) throws Error { diff --git a/src/rygel/rygel-media-item.vala b/src/rygel/rygel-media-item.vala index 337eb9f..0f10a6d 100644 --- a/src/rygel/rygel-media-item.vala +++ b/src/rygel/rygel-media-item.vala @@ -64,6 +64,8 @@ public class Rygel.MediaItem : MediaObject { public ArrayList thumbnails; + internal bool place_holder = false; + public MediaItem (string id, MediaContainer parent, string title, -- 2.7.4