For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /music-assistant/faq/get_queue.md.

MA get_queue 操作

此操作允许您检索队列的详细信息

!image

返回的 JSON 非常广泛,包括有关队列中当前和下一个项目的信息。返回的数据可在模板中使用

示例

script:
  get_now_playing:
    mode: queued
    alias: "获取正在播放的音轨名称"
    sequence:
      - action: music_assistant.get_queue
        data:
          entity_id: media_player.ma_kitchen_speaker
        response_variable: queue_info
      - service: input_text.set_value
        data:
          entity_id: input_text.now_playing
          value: '{{ queue_info['media_player.ma_kitchen_speaker'].current_item.name[:50] }}'