mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Fix the types of some MPRIS metadata fields.
(cherry picked from commit 1abd9c3821
)
This commit is contained in:
parent
8ddc5064dc
commit
3c9c4ab538
@ -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
Block a user