def _set_data_from_metadata(self, player, data):
        """Set any data retrieved directly from the metadata for a player"""
        metadata = dict(player.props.metadata)

        data["trackNumber"] = metadata.get("xesam:trackNumber")

        duration_ms = metadata.get("mpris:length")
        if duration_ms:
            data["duration"] = self._microseconds_to_time(duration_ms)
        else:
            data["duration"] = None
Set any data retrieved directly from the metadata for a player
py3status/modules/playerctl.py