[rygel] all: Port to glib's Uuid.string_random()



commit 7cf4eacbea558539504d9a45d41fdfacedaf062d
Author: Jens Georg <mail jensge org>
Date:   Tue Jun 14 13:11:35 2022 +0200

    all: Port to glib's Uuid.string_random()
    
    No more need for our own UUID function since GLib has its own

 src/librygel-core/rygel-root-device-factory.vala                    | 2 +-
 src/librygel-server/rygel-content-directory.vala                    | 4 ++--
 src/librygel-server/rygel-object-creator.vala                       | 2 +-
 src/librygel-server/rygel-trackable-container.vala                  | 2 +-
 src/plugins/media-export/rygel-media-export-media-cache.vala        | 6 +++---
 .../media-export/rygel-media-export-playlist-root-container.vala    | 2 +-
 6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/librygel-core/rygel-root-device-factory.vala 
b/src/librygel-core/rygel-root-device-factory.vala
index 66afb588..dca29540 100644
--- a/src/librygel-core/rygel-root-device-factory.vala
+++ b/src/librygel-core/rygel-root-device-factory.vala
@@ -136,7 +136,7 @@ public class Rygel.RootDeviceFactory : Object,
             try {
                 udn = this.config.get_string (plugin.name, "uuid");
             } catch (Error error) {
-                udn = GUPnP.get_uuid ();
+                udn = Uuid.string_random ();
             }
             file.set_udn ("uuid:" + udn);
         }
diff --git a/src/librygel-server/rygel-content-directory.vala 
b/src/librygel-server/rygel-content-directory.vala
index 7c5c3ee1..5afcf7a4 100644
--- a/src/librygel-server/rygel-content-directory.vala
+++ b/src/librygel-server/rygel-content-directory.vala
@@ -105,7 +105,7 @@ public class Rygel.ContentDirectory: Service {
             this.service_reset_token = trackable.get_service_reset_token ();
             this.system_update_id = trackable.get_system_update_id ();
         } else {
-            this.service_reset_token = GUPnP.get_uuid ();
+            this.service_reset_token = Uuid.string_random ();
             this.system_update_id = 0;
         }
 
@@ -708,7 +708,7 @@ public class Rygel.ContentDirectory: Service {
 
         var plugin = this.root_device.resource_factory as MediaServerPlugin;
         plugin.active = false;
-        this.service_reset_token = GUPnP.get_uuid ();
+        this.service_reset_token = Uuid.string_random ();
         if (this.root_container is TrackableContainer) {
             var trackable = this.root_container as TrackableContainer;
             trackable.set_service_reset_token (this.service_reset_token);
diff --git a/src/librygel-server/rygel-object-creator.vala b/src/librygel-server/rygel-object-creator.vala
index 15f9cae2..6aa564ce 100644
--- a/src/librygel-server/rygel-object-creator.vala
+++ b/src/librygel-server/rygel-object-creator.vala
@@ -700,7 +700,7 @@ internal class Rygel.ObjectCreator: GLib.Object, Rygel.StateMachine {
                                                     "_",
                                                     RegexMatchFlags.NOTEMPTY);
 
-        return GUPnP.get_uuid () + "-" + mangled;
+        return Uuid.string_random () + "-" + mangled;
     }
 
     /**
diff --git a/src/librygel-server/rygel-trackable-container.vala 
b/src/librygel-server/rygel-trackable-container.vala
index 65509663..b4d5e5ff 100644
--- a/src/librygel-server/rygel-trackable-container.vala
+++ b/src/librygel-server/rygel-trackable-container.vala
@@ -123,7 +123,7 @@ public interface Rygel.TrackableContainer : Rygel.MediaContainer {
      * version.
      */
     public virtual string get_service_reset_token () {
-        return GUPnP.get_uuid ();
+        return Uuid.string_random ();
     }
 
     /**
diff --git a/src/plugins/media-export/rygel-media-export-media-cache.vala 
b/src/plugins/media-export/rygel-media-export-media-cache.vala
index 13bbcbb0..7277f053 100644
--- a/src/plugins/media-export/rygel-media-export-media-cache.vala
+++ b/src/plugins/media-export/rygel-media-export-media-cache.vala
@@ -525,7 +525,7 @@ public class Rygel.MediaExport.MediaCache : Object {
         } catch (DatabaseError error) {
             warning (_("Failed to get reset token"));
 
-            return GUPnP.get_uuid ();
+            return Uuid.string_random ();
         }
     }
 
@@ -581,7 +581,7 @@ public class Rygel.MediaExport.MediaCache : Object {
         if (object.ref_id == null) {
             object.ref_id = object.id;
         }
-        object.id = GUPnP.get_uuid ();
+        object.id = Uuid.string_random ();
 
         this.save_item (object as MediaFileItem);
 
@@ -889,7 +889,7 @@ public class Rygel.MediaExport.MediaCache : Object {
             db.exec (this.sql.make (SQLString.TRIGGER_REFERENCE));
             db.commit ();
             db.analyze ();
-            this.save_reset_token (GUPnP.get_uuid ());
+            this.save_reset_token (Uuid.string_random ());
 
             return true;
         } catch (Error err) {
diff --git a/src/plugins/media-export/rygel-media-export-playlist-root-container.vala 
b/src/plugins/media-export/rygel-media-export-playlist-root-container.vala
index 3e0b275b..f72b7e8b 100644
--- a/src/plugins/media-export/rygel-media-export-playlist-root-container.vala
+++ b/src/plugins/media-export/rygel-media-export-playlist-root-container.vala
@@ -94,7 +94,7 @@ internal class Rygel.MediaExport.PlaylistRootContainer : Rygel.WritableContainer
                                          this.id);
         }
 
-        container.id = "playlist:" + GUPnP.get_uuid ();
+        container.id = "playlist:" + Uuid.string_random ();
         container.upnp_class = Rygel.MediaContainer.PLAYLIST;
 
         this.media_db.save_container (container);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]