ListenBrainzScrobbler: Only send duration_ms when valid

This commit is contained in:
Jonas Kvinge 2023-04-21 20:54:18 +02:00
parent 8edb6eaa81
commit 7202a5734c
1 changed files with 3 additions and 1 deletions

View File

@ -384,7 +384,9 @@ QJsonObject ListenBrainzScrobbler::JsonTrackMetadata(const ScrobbleMetadata &met
QJsonObject object_additional_info;
object_additional_info.insert("duration_ms", metadata.length_nanosec / kNsecPerMsec);
if (metadata.length_nanosec > 0) {
object_additional_info.insert("duration_ms", metadata.length_nanosec / kNsecPerMsec);
}
if (metadata.track > 0) {
object_additional_info.insert("tracknumber", metadata.track);