// The media object corresponding to object_id
MediaObject media_object;
- private unowned ContentDirectory content_dir;
+ private MediaContainer root_container;
private ServiceAction action;
private Rygel.DIDLLiteWriter didl_writer;
public Browse (ContentDirectory content_dir,
owned ServiceAction action) {
- this.content_dir = content_dir;
+ this.root_container = content_dir.root_container;
this.action = (owned) action;
this.didl_writer =
- new Rygel.DIDLLiteWriter (this.content_dir.http_server);
+ new Rygel.DIDLLiteWriter (content_dir.http_server);
}
public void start () {
}
private bool fetch_media_object () {
+ if (this.object_id == this.root_container.id) {
+ this.media_object = this.root_container;
+
+ return true;
+ }
+
try {
this.media_object =
- this.content_dir.find_object_by_id (this.object_id);
+ this.root_container.find_object_by_id (this.object_id);
} catch (Error err) {
this.handle_error (err);
return false;
string didl = this.didl_writer.get_string ();
if (this.update_id == uint32.MAX) {
- this.update_id = this.content_dir.root_container.update_id;
+ this.update_id = this.root_container.update_id;
}
/* Set action return arguments */
* Responsible for handling HTTP client requests.
*/
public class Rygel.HTTPRequest : GLib.Object {
- private unowned ContentDirectory content_dir;
+ private MediaContainer root_container;
private Soup.Server server;
private Soup.Message msg;
private HashTable<string,string>? query;
private MediaItem item;
private Seek seek;
- public HTTPRequest (ContentDirectory content_dir,
+ public HTTPRequest (MediaContainer root_container,
Soup.Server server,
Soup.Message msg,
HashTable<string,string>? query) {
- this.content_dir = content_dir;
+ this.root_container = root_container;
this.server = server;
this.msg = msg;
this.query = query;
MediaObject media_object;
try {
- media_object = this.content_dir.find_object_by_id (this.item_id);
+ media_object = this.root_container.find_object_by_id (this.item_id);
} catch (Error error) {
this.handle_error (error);
return;
private const string SERVER_PATH_PREFIX = "/RygelHTTPServer";
private string path_root;
- // Reference to associated ContentDirectory service
- private unowned ContentDirectory content_dir;
+ // Reference to root container of associated ContentDirectory
+ private MediaContainer root_container;
private GUPnP.Context context;
private ArrayList<HTTPRequest> requests;
public HTTPServer (ContentDirectory content_dir,
string name) {
- this.content_dir = content_dir;
+ this.root_container = content_dir.root_container;
this.context = content_dir.context;
this.requests = new ArrayList<HTTPRequest> ();
string server_path,
HashTable<string,string>? query,
Soup.ClientContext soup_client) {
- var request = new HTTPRequest (this.content_dir, server, msg, query);
+ var request = new HTTPRequest (this.root_container, server, msg, query);
request.handled += this.on_request_handled;
this.requests.add (request);