Fix the types of some MPRIS metadata fields.
This commit is contained in:
parent
1cec34b1f6
commit
1abd9c3821
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<int>(bpm()), map);
|
||||
AddMetadataAsList("xesam:composer", composer(), map);
|
||||
AddMetadata("xesam:useCount", playcount(), map);
|
||||
AddMetadata("xesam:autoRating", score(), map);
|
||||
|
|
Loading…
Reference in New Issue