Export optical drive types
There's currently no way to list all the drives that handle a particular type of media, without resorting to hacks like (without memory management):
gicon = g_drive_get_icon (gd);
if (!gicon)
return ret;
if (!G_IS_THEMED_ICON (icon))
return ret;
g_object_get (icon, "names", &names, NULL);
ret = g_strv_contains (names, "drive-optical");
Once a disc is inserted, and is mounted, one can check the tree content-type, but not before it's mounted, something which might not be automatic in non-GNOME desktops.
Ideally, gvfs would export that information which is available through udisks already:
$ gdbus introspect --system --dest org.freedesktop.UDisks2 --object-path /org/freedesktop/UDisks2/drives/HL_DT_ST_DVD_ROM_DUE0N_KZHI8G84454 | grep MediaCompatibility
readonly as MediaCompatibility = ['optical_cd', 'optical_dvd'];
and it's also available on Windows:
- https://github.com/HandBrake/HandBrake/blob/master/gtk/src/callbacks.c#L4913-L4921
- https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdrivetypea#return-value
(This is a bit like #241, but narrower)
@oholy what do you think?