Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c37563c authored by Ted Wang's avatar Ted Wang
Browse files

Send the only song in queue as now playing song when get item attributes

of now playing

Bug: 152007084
Test: Manully
Change-Id: I1d31612f20fe21e8364c578718ca282eeb75eac0
Merged-In: I1d31612f20fe21e8364c578718ca282eeb75eac0
parent 921bcc3c
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -995,11 +995,18 @@ void Device::GetItemAttributesNowPlayingResponse(
  DEVICE_VLOG(2) << __func__ << ": media_id=\"" << media_id << "\"";

  SongInfo info;
  if (song_list.size() == 1) {
    DEVICE_VLOG(2)
        << __func__
        << " Send out the only song in the queue as now playing song.";
    info = song_list.front();
  } else {
    for (const auto& temp : song_list) {
      if (temp.media_id == media_id) {
        info = temp;
      }
    }
  }

  auto attributes_requested = pkt->GetAttributesRequested();
  if (attributes_requested.size() != 0) {