item_factory.upload_dir,
error.message);
}
+
+ this.resources.graph_updated.connect (this.on_graph_updated);
}
public async void add_item (MediaItem item, Cancellable? cancellable)
item.id = this.create_child_id_for_urn (urn);
item.parent = this;
-
- this.child_count++;
- this.updated ();
}
public async void remove_item (string id, Cancellable? cancellable)
var urn = this.get_item_info (id, out parent_id);
yield this.remove_entry_from_store (urn);
+ }
+
+ private void on_graph_updated (string class_name,
+ Event[] deletes,
+ Event[] inserts) {
+ var our_suffix = this.item_factory.category.replace (":", "#");
+ if (!class_name.has_suffix (our_suffix)) {
+ return;
+ }
- this.child_count--;
- this.updated ();
+ this.get_children_count.begin ();
}
private async string create_entry_in_store (MediaItem item) throws Error {
}
this.fetch_metadata_values.begin ();
-
- this.resources.graph_updated.connect (this.on_graph_updated);
}
private async void fetch_metadata_values () {
RESOURCES_PATH);
}
- private void on_graph_updated (string class_name,
- Event[] deletes,
- Event[] inserts) {
- var our_suffix = this.item_factory.category.replace (":", "#");
- if (!class_name.has_suffix (our_suffix)) {
- return;
- }
-
- this.fetch_metadata_values.begin ();
- }
-
private bool is_child_id_unique (string child_id) {
var unique = true;