1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2025-01-23 22:20:51 +01:00

TagReaderTagLib: Read FMPS_Rating for MPEG ID3v2 tag

This commit is contained in:
Jonas Kvinge 2021-10-26 01:10:01 +02:00
parent 704e6c5448
commit 6b64c43851

View File

@ -318,6 +318,16 @@ void TagReaderTagLib::ReadFile(const QString &filename, spb::tagreader::SongMeta
}
}
if (TagLib::ID3v2::UserTextIdentificationFrame *frame_fmps_rating = TagLib::ID3v2::UserTextIdentificationFrame::find(file_mpeg->ID3v2Tag(), "FMPS_Rating")) {
TagLib::StringList frame_field_list = frame_fmps_rating->fieldList();
if (frame_field_list.size() > 1) {
double rating = TStringToQString(frame_field_list[1]).toDouble();
if (song->rating() <= 0 && rating > 0 && rating <= 1.0) {
song->set_rating(rating);
}
}
}
if (!map["POPM"].isEmpty()) {
const TagLib::ID3v2::PopularimeterFrame *frame = dynamic_cast<const TagLib::ID3v2::PopularimeterFrame*>(map["POPM"].front());
if (frame) {