D8957: Add title, artist and album to MPRIS network packets

Nicolas Fella noreply at phabricator.kde.org
Wed Dec 20 17:10:55 UTC 2017


nicolasfella added inline comments.

INLINE COMMENTS

> mpriscontrolplugin.cpp:135
> +            QString nowPlaying = title;
> +            QString artist = nowPlayingMap[QStringLiteral("xesam:artist")].toString();
> +            np.set(QStringLiteral("title"), title);

I would rather extract all metadata like:

  if (nowPlayingMap.contains(QStringLiteral("xesam:foo"))) {
      QString foo = nowPlayingMap[QStringLiteral("xesam:foo")].toString();
  }
  ....

And compose the nowPlaying at the end. This way all the ifs have the same structure and the artist isn't checked twice.

> mpriscontrolplugin.cpp:146
> +        } else {
> +            np.set(QStringLiteral("artist"), QStringLiteral(""));
> +        }

Please check whether it's really necessary to set it to an empty string or it's the default case. I'm not sure about that right now :)

REPOSITORY
  R224 KDE Connect

REVISION DETAIL
  https://phabricator.kde.org/D8957

To: mtijink, #kde_connect, apol
Cc: nicolasfella, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20171220/db494b61/attachment.html>


More information about the KDEConnect mailing list