diff --git a/src/core/mpris_common.h b/src/core/mpris_common.h index 218c3e3fc..b65dc7e4d 100644 --- a/src/core/mpris_common.h +++ b/src/core/mpris_common.h @@ -37,6 +37,14 @@ inline void AddMetadata(const QString& key, int metadata, QVariantMap* map) { if (metadata > 0) (*map)[key] = metadata; } +inline void AddMetadata(const QString& key, qint64 metadata, QVariantMap* map) { + if (metadata > 0) (*map)[key] = metadata; +} + +inline void AddMetadata(const QString& key, double metadata, QVariantMap* map) { + if (metadata != 0.0) (*map)[key] = metadata; +} + inline void AddMetadata(const QString& key, const QDateTime& metadata, QVariantMap* map) { if (metadata.isValid()) (*map)[key] = metadata; } diff --git a/src/core/song.cpp b/src/core/song.cpp index 23c757042..d4d1dd581 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -1169,7 +1169,7 @@ void Song::ToXesam(QVariantMap* map) const { AddMetadataAsList("xesam:comment", comment(), map); AddMetadata("xesam:contentCreated", AsMPRISDateTimeType(ctime()), map); AddMetadata("xesam:lastUsed", AsMPRISDateTimeType(lastplayed()), map); - AddMetadata("xesam:audioBPM", bpm(), map); + AddMetadata("xesam:audioBPM", static_cast(bpm()), map); AddMetadataAsList("xesam:composer", composer(), map); AddMetadata("xesam:useCount", playcount(), map); AddMetadata("xesam:autoRating", score(), map);