public MediaContainer root_container;
private ArrayList<MediaContainer> updated_containers;
+ private ArrayList<ImportResource> active_imports;
+
private bool clear_updated_containers;
private uint update_notify_id;
}
this.updated_containers = new ArrayList<MediaContainer> ();
+ this.active_imports = new ArrayList<ImportResource> ();
this.root_container.container_updated += on_container_updated;
owned ServiceAction action) {
var import = new ImportResource (this, action);
+ import.completed += this.on_import_completed;
+ this.active_imports.add (import);
+
import.run.begin ();
}
+ private void on_import_completed (ImportResource import) {
+ // According to CDS specs (v3 section 2.4.17), we must not immediately
+ // remove the import from out memory
+ Timeout.add_seconds (30, () => {
+ this.active_imports.remove (import);
+
+ return false;
+ });
+ }
+
/* GetSystemUpdateID action implementation */
private void get_system_update_id_cb (ContentDirectory content_dir,
owned ServiceAction action) {