Metadata.fromMap constructor

Metadata.fromMap(
  1. Map<String, DBusValue> map
)

Implementation

factory Metadata.fromMap(Map<String, DBusValue> map) => Metadata(
      (map['mpris:trackid'] as DBusString).value,
      (map['xesam:title'] as DBusString).value,
      ((map['xesam:artist'] as DBusArray).children)
          .map((e) => (e as DBusString).value)
          .toList(),
      map['xesam:trackNumber'] is DBusInt32
          ? (map['xesam:trackNumber'] as DBusInt32).value
          : (map['xesam:trackNumber'] as DBusUint32).value,
      (map['xesam:url'] as DBusString).value,
      Duration(
        microseconds: map['mpris:length'] is DBusUint64
            ? (map['mpris:length'] as DBusUint64).value
            : (map['mpris:length'] as DBusInt64).value,
      ),
      (map['mpris:artUrl'] as DBusString).value,
      (map['xesam:album'] as DBusString).value,
      ((map['xesam:albumArtist'] as DBusArray).children)
          .map((e) => (e as DBusString).value)
          .toList(),
      map['xesam:discNumber'] is DBusInt32
          ? (map['xesam:discNumber'] as DBusInt32).value
          : (map['xesam:discNumber'] as DBusUint32).value,
    );