Generate UDN when creating description first time
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sun, 24 May 2009 20:09:56 +0000 (23:09 +0300)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Sun, 24 May 2009 20:09:56 +0000 (23:09 +0300)
We still want to generate UDN the first time user runs rygel but now we
check if UDN already exists in the description rather than in config.

src/rygel/rygel-media-server-factory.vala

index 0315316..cd24362 100644 (file)
@@ -168,7 +168,12 @@ public class Rygel.MediaServerFactory {
             return;
         }
 
-        element->set_content (this.config.get_udn (plugin_name));
+        var udn = element->get_content ();
+        if (udn == null || udn == "") {
+            udn = Utils.generate_random_udn ();
+
+            element->set_content (udn);
+        }
     }
 
     private void add_services_to_desc (Xml.Node *device_element,