hzeller / gmrender-resurrect

Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer. Fork of GMediaRenderer to add some features to make it usable.
GNU General Public License v2.0
834 stars 202 forks source link

automatic persistent UUID #66

Open grawity opened 9 years ago

grawity commented 9 years ago

Low-priority enhancement idea.

From the description of --uuid, it sounds like the UUID should be the same every time gmrender starts, to let players recognize it as the same device. So perhaps gmrender should automatically use a persistent UUID?

Many Linux distributions have a persistent host ID at /etc/machine-id. (It's a valid UUID v4, just missing the dashes.) Older ones keep the same ID at /var/lib/dbus/machine-id. (This is usually a valid UUID v4.) FreeBSD has a /etc/hostid (although only FreeBSD has an UUID there; other systems have a short useless 4-byte ID).

If the UUID must be per-user instead, then maybe generate one on first start, and store it in g_get_user_config_dir()/gmrender/uuid?