// pattern contains URL escaped text. This means it might
// contain '%' chars which will makes sprintf crash
new_id = this.pattern.replace ("%s", new_id);
- new_id = register_id (new_id);
+ register_id (ref new_id);
var container = new MediaExportQueryContainer (this.media_db,
new_id,
meta_data);
return children;
}
- public static string register_id (string id) {
+ public static void register_id (ref string id) {
var md5 = Checksum.compute_for_string (ChecksumType.MD5, id);
if (virtual_container_map == null) {
virtual_container_map = new HashMap<string,string> ();
debug ("registering %s for %s", md5, id);
}
- return PREFIX + md5;
+ id = PREFIX + md5;
}
public static string? get_virtual_container_definition (string hash) {
exp.op == SearchCriteriaOp.EQ) {
switch (exp.operand2) {
case "object.container.album.musicAlbum":
- return new MediaExportQueryContainer (
- this.media_db,
- MediaExportQueryContainer.register_id
- ("virtual-container:upnp:album,?"),
- "Albums");
+ string id = "virtual-container:upnp:album,?";
+ MediaExportQueryContainer.register_id (ref id);
+
+ return new MediaExportQueryContainer (this.media_db,
+ id,
+ "Albums");
case "object.container.person.musicArtist":
- return new MediaExportQueryContainer (
- this.media_db,
- MediaExportQueryContainer.register_id
- ("virtual-container:dc:creator,?,upnp:album,?"),
- "Artists");
+ string id = "virtual-container:dc:creator,?,upnp:album,?";
+ MediaExportQueryContainer.register_id (ref id);
+
+ return new MediaExportQueryContainer (this.media_db,
+ id,
+ "Artists");
default:
return null;
}
Uri.escape_string (exp_.operand2, "", true) +
last_argument;
debug ("Translated search request to %s", new_id);
- new_id = MediaExportQueryContainer.register_id (new_id);
+ MediaExportQueryContainer.register_id (ref new_id);
query_container = new MediaExportQueryContainer (
this.media_db,
new_id,
continue;
}
- id = MediaExportQueryContainer.register_id (id);
+ MediaExportQueryContainer.register_id (ref id);
var virtual_container = new MediaExportQueryContainer (
this.media_db,