Cancellable? cancellable)
throws GLib.Error {
var children = new MediaObjects ();
+ var factory = QueryContainerFactory.get_default ();
+
+ if (this.add_all_container ()) {
+ var id = this.template.replace (",upnp:album,%s","");
+ var container = factory.create_from_description (this.media_db,
+ id,
+ _("All"));
+ container.parent = this;
+ children.add (container);
+ }
+
var data = this.media_db.get_object_attribute_by_search_expression
(this.attribute,
this.expression,
// template contains URL escaped text. This means it might
// contain '%' chars which will makes sprintf crash
new_id = this.template.replace ("%s", new_id);
- var factory = QueryContainerFactory.get_default ();
var container = factory.create_from_description (this.media_db,
new_id,
meta_data);
this.expression,
0,
-1);
+ if (this.add_all_container ()) {
+ return data.size + 1;
+ }
+
return data.size;
}
+
+ private bool add_all_container () {
+ return this.attribute == "upnp:album" &&
+ "upnp:artist" in this.template;
+ }
}