MediaItem item;
if (this.child_class == MediaItem.VIDEO_CLASS) {
- item = new TrackerVideoItem (this.id + ":" + path, path, this);
+ item = new TrackerVideoItem (this.id + ":" + path,
+ path,
+ this,
+ null);
} else if (this.child_class == MediaItem.IMAGE_CLASS) {
- item = new TrackerImageItem (this.id + ":" + path, path, this);
+ item = new TrackerImageItem (this.id + ":" + path,
+ path,
+ this,
+ null);
} else {
- item = new TrackerMusicItem (this.id + ":" + path, path, this);
+ item = new TrackerMusicItem (this.id + ":" + path,
+ path,
+ this,
+ null);
}
return item;
LAST_KEY
}
- public TrackerImageItem (string id,
- string path,
- TrackerContainer parent) throws GLib.Error {
- base (id, path, parent);
+ public TrackerImageItem (string id,
+ string path,
+ TrackerContainer parent,
+ string[]? metadata) throws GLib.Error {
+ base (id, path, parent, metadata);
}
public override string[] get_metadata_keys () {
public TrackerItem (string id,
string path,
- TrackerContainer parent) throws GLib.Error {
+ TrackerContainer parent,
+ string[]? metadata) throws GLib.Error {
base (id, parent.id, "", parent.child_class);
this.path = path;
this.parent = parent;
- var values = this.fetch_metadata ();
+ string[] values;
+ if (metadata == null) {
+ values = this.fetch_metadata ();
+ } else {
+ values = metadata;
+ }
+
this.init_from_metadata (values);
}
LAST_KEY
}
- public TrackerMusicItem (string id,
- string path,
- TrackerContainer parent) throws GLib.Error {
- base (id, path, parent);
+ public TrackerMusicItem (string id,
+ string path,
+ TrackerContainer parent,
+ string[]? metadata) throws GLib.Error {
+ base (id, path, parent, metadata);
}
public override string[] get_metadata_keys () {
LAST_KEY
}
- public TrackerVideoItem (string id,
- string path,
- TrackerContainer parent) throws GLib.Error {
- base (id, path, parent);
+ public TrackerVideoItem (string id,
+ string path,
+ TrackerContainer parent,
+ string[]? metadata) throws GLib.Error {
+ base (id, path, parent, metadata);
}
public override string[] get_metadata_keys () {