[rygel] server: Fix item upload
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] server: Fix item upload
- Date: Sun, 8 Feb 2015 13:25:43 +0000 (UTC)
commit 2db060e845affbecca73792e122cd3e8559c510e
Author: Jens Georg <mail jensge org>
Date: Sat Jan 10 13:42:46 2015 +0100
server: Fix item upload
Sever was not adding any resources on placeholder items.
Signed-off-by: Jens Georg <mail jensge org>
src/librygel-server/rygel-media-file-item.vala | 3 +--
src/librygel-server/rygel-media-object.vala | 9 ++++++++-
src/librygel-server/rygel-media-resource.vala | 1 +
3 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/librygel-server/rygel-media-file-item.vala b/src/librygel-server/rygel-media-file-item.vala
index d915c5a..ecf1d32 100644
--- a/src/librygel-server/rygel-media-file-item.vala
+++ b/src/librygel-server/rygel-media-file-item.vala
@@ -215,9 +215,8 @@ public abstract class Rygel.MediaFileItem : MediaItem {
this.add_additional_resources (http_server);
this.add_proxy_resources (http_server, didl_item);
-
- this.serialize_resource_list (didl_item, http_server);
}
+ this.serialize_resource_list (didl_item, http_server);
return didl_item;
}
diff --git a/src/librygel-server/rygel-media-object.vala b/src/librygel-server/rygel-media-object.vala
index e05d467..a1d1e30 100644
--- a/src/librygel-server/rygel-media-object.vala
+++ b/src/librygel-server/rygel-media-object.vala
@@ -254,15 +254,22 @@ public abstract class Rygel.MediaObject : GLib.Object {
throws Error {
foreach (var res in this.get_resource_list ()) {
if (res.uri == null || res.uri == "") {
- res.uri = http_server.create_uri_for_object (this,
+ var uri = http_server.create_uri_for_object (this,
-1,
-1,
null,
res.get_name ());
+ if (this is MediaFileItem &&
+ (this as MediaFileItem).place_holder) {
+ res.import_uri = uri;
+ } else {
+ res.uri = uri;
+ }
var didl_resource = didl_object.add_resource ();
http_server.set_resource_delivery_options (res);
res.serialize (didl_resource);
res.uri = null;
+ res.import_uri = null;
} else {
try {
var protocol = this.get_protocol_for_uri (res.uri);
diff --git a/src/librygel-server/rygel-media-resource.vala b/src/librygel-server/rygel-media-resource.vala
index c0986bf..178412b 100644
--- a/src/librygel-server/rygel-media-resource.vala
+++ b/src/librygel-server/rygel-media-resource.vala
@@ -164,6 +164,7 @@ public class Rygel.MediaResource : GLib.Object {
public DIDLLiteResource serialize (DIDLLiteResource didl_resource) {
// Note: For a DIDLLiteResource, a value of -1/null also signals "not set"
didl_resource.uri = this.uri;
+ didl_resource.import_uri = this.import_uri;
didl_resource.size64 = this.size;
didl_resource.cleartext_size = this.cleartext_size;
didl_resource.duration = this.duration;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]