public Browse (ContentDirectory content_dir,
owned ServiceAction action) {
- base (content_dir,
- action,
- "ObjectID",
- _("Failed to browse '%s': %s\n"));
+ base (content_dir, action);
+
+ if (this.xbox_hacks != null) {
+ this.object_id_arg = "ContainerID";
+ } else {
+ this.object_id_arg = "ObjectID";
+ }
}
protected override void parse_args () throws Error {
return children;
}
+
+ protected override void handle_error (Error error) {
+ warning (_("Failed to browse '%s': %s\n"),
+ this.object_id,
+ error.message);
+
+ base.handle_error (error);
+ }
}
protected ServiceAction action;
protected Rygel.DIDLLiteWriter didl_writer;
protected XBoxHacks xbox_hacks;
+ protected string object_id_arg;
- private string object_id_arg;
- private string error_message;
protected MediaQueryAction (ContentDirectory content_dir,
- owned ServiceAction action,
- string object_id_arg,
- string error_message) {
+ owned ServiceAction action) {
this.root_container = content_dir.root_container;
this.system_update_id = content_dir.system_update_id;
this.cancellable = content_dir.cancellable;
this.action = (owned) action;
- this.object_id_arg = object_id_arg;
- this.error_message = error_message;
this.didl_writer = new Rygel.DIDLLiteWriter (content_dir.http_server);
out this.sort_criteria);
if (this.object_id == null) {
- /* Stupid Xbox */
- this.action.get ("ContainerID",
- typeof (string),
- out this.object_id);
- }
-
- if (this.object_id == null) {
// Sorry we can't do anything without ObjectID
throw new ContentDirectoryError.NO_SUCH_OBJECT (
_("No such object"));
this.completed ();
}
- private void handle_error (Error error) {
- warning (this.error_message, this.object_id, error.message);
-
+ protected virtual void handle_error (Error error) {
if (error is ContentDirectoryError) {
this.action.return_error (error.code, error.message);
} else {
public Search (ContentDirectory content_dir,
owned ServiceAction action) {
- base (content_dir,
- action,
- "ContainerID",
- _("Failed to search in '%s': %s"));
+ base (content_dir, action);
+
+ this.object_id_arg = "ContainerID";
}
protected override void parse_args () throws Error {
return results;
}
+
+ protected override void handle_error (Error error) {
+ warning (_("Failed to search in '%s': %s"),
+ this.object_id,
+ error.message);
+
+ base.handle_error (error);
+ }
}