MediaContainer derivates must implement find_object_by_id method.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Wed, 28 Jan 2009 12:33:57 +0000 (12:33 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Wed, 28 Jan 2009 12:33:57 +0000 (12:33 +0000)
svn path=/trunk/; revision=505

src/plugins/dvb/rygel-dvb-channel-group.vala
src/plugins/dvb/rygel-dvb-content-dir.vala
src/plugins/tracker/rygel-media-tracker.vala
src/plugins/tracker/rygel-tracker-container.vala

index ac14efb..42c72e4 100644 (file)
@@ -78,8 +78,8 @@ public class Rygel.DVBChannelGroup : MediaContainer {
         return this.channels.slice ((int) offset, (int) stop);
     }
 
-    public DVBChannel find_channel (string id) {
-        DVBChannel channel = null;
+    public MediaObject find_object_by_id (string id) {
+        MediaObject channel = null;
         foreach (var tmp in this.channels) {
             if (tmp.id == id) {
                 channel = tmp;
index 2789521..296f561 100644 (file)
@@ -176,11 +176,11 @@ public class Rygel.DVBContentDir : ContentDirectory {
         return group;
     }
 
-    private DVBChannel find_channel_by_id (string id) throws GLib.Error {
-        DVBChannel channel = null;
+    private MediaObject find_channel_by_id (string id) throws GLib.Error {
+        MediaObject channel = null;
 
         foreach (DVBChannelGroup group in this.groups) {
-            channel = group.find_channel (id);
+            channel = group.find_object_by_id (id);
             if (channel != null) {
                 break;
             }
index ed5f925..6024e57 100644 (file)
@@ -95,7 +95,7 @@ public class Rygel.MediaTracker : ContentDirectory {
             var container = get_item_parent (object_id);
 
             if (container != null)
-                media_object = container.get_item_from_db (object_id);
+                media_object = container.find_object_by_id (object_id);
         }
 
         if (media_object == null) {
index 5bf6d63..a512496 100644 (file)
@@ -129,7 +129,7 @@ public class Rygel.TrackerContainer : MediaContainer {
 
         /* Iterate through all items */
         for (uint i = 0; i < child_paths.length; i++) {
-            MediaItem item = this.get_item_from_db (child_paths[i]);
+            MediaItem item = this.find_object_by_id (child_paths[i]);
             children.add (item);
         }
 
@@ -144,8 +144,9 @@ public class Rygel.TrackerContainer : MediaContainer {
         return category;
     }
 
-    public MediaItem get_item_from_db (string path) throws GLib.Error {
+    public MediaItem find_object_by_id (string id) throws GLib.Error {
         MediaItem item;
+        string path = id;
 
         if (this.child_class == MediaItem.VIDEO_CLASS) {
             item = new TrackerVideoItem (path, path, this);