[rygel] tracker: Update for new resource handling
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel] tracker: Update for new resource handling
- Date: Mon, 16 Mar 2015 21:41:50 +0000 (UTC)
commit 67677290aeec445179bd40c64805ddca750bff0c
Author: Jens Georg <mail jensge org>
Date: Mon Mar 16 09:09:49 2015 +0100
tracker: Update for new resource handling
Signed-off-by: Jens Georg <mail jensge org>
.../tracker/rygel-tracker-item-factory.vala | 15 +++++++++++++++
.../tracker/rygel-tracker-music-item-factory.vala | 2 ++
.../rygel-tracker-picture-item-factory.vala | 2 ++
.../tracker/rygel-tracker-video-item-factory.vala | 2 ++
4 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/tracker/rygel-tracker-item-factory.vala
b/src/plugins/tracker/rygel-tracker-item-factory.vala
index 2b86881..dae3840 100644
--- a/src/plugins/tracker/rygel-tracker-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-item-factory.vala
@@ -137,5 +137,20 @@ public abstract class Rygel.Tracker.ItemFactory {
item.add_uri (uri);
}
+
+ protected virtual void add_resources (MediaItem item) throws GLib.Error {
+ // Call the MediaEngine to determine which item representations it can support
+ var media_engine = MediaEngine.get_default ( );
+ media_engine.get_resources_for_item.begin (item,
+ (obj, res) => {
+ var added_resources = media_engine.get_resources_for_item.end (res);
+ debug ("Adding %d resources to item source %s",
+ added_resources.size, item.get_primary_uri () );
+ foreach (var resrc in added_resources) {
+ debug ("Tracker item media resource %s", resrc.get_name ());
+ }
+ item.get_resource_list ().add_all (added_resources);
+ });
+ }
}
diff --git a/src/plugins/tracker/rygel-tracker-music-item-factory.vala
b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
index 802d8fe..a852500 100644
--- a/src/plugins/tracker/rygel-tracker-music-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
@@ -137,6 +137,8 @@ public class Rygel.Tracker.MusicItemFactory : ItemFactory {
}
music.lookup_album_art ();
+
+ base.add_resources(music);
}
}
diff --git a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
index 8282f0e..40e19ed 100644
--- a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
@@ -85,6 +85,8 @@ public class Rygel.Tracker.PictureItemFactory : ItemFactory {
if (metadata.is_bound (PictureMetadata.HEIGHT)) {
photo.height = (int) metadata.get_integer (PictureMetadata.HEIGHT);
}
+
+ base.add_resources(photo);
}
}
diff --git a/src/plugins/tracker/rygel-tracker-video-item-factory.vala
b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
index 95a5667..66575d0 100644
--- a/src/plugins/tracker/rygel-tracker-video-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
@@ -90,6 +90,8 @@ public class Rygel.Tracker.VideoItemFactory : ItemFactory {
if (metadata.is_bound (VideoMetadata.DURATION))
video.duration = (int) metadata.get_integer
(VideoMetadata.DURATION);
+
+ base.add_resources(video);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]