1
0
mirror of https://github.com/strawberrymusicplayer/strawberry synced 2024-12-18 19:42:53 +01:00

Fix reading ASF comment tag

This commit is contained in:
Jonas Kvinge 2020-08-03 21:03:14 +02:00
parent f9d45f7657
commit 3ff4885973
2 changed files with 7 additions and 3 deletions

View File

@ -358,6 +358,10 @@ void TagReader::ReadFile(const QString &filename, pb::tagreader::SongMetadata *s
song->set_bitdepth(file_asf->audioProperties()->bitsPerSample()); song->set_bitdepth(file_asf->audioProperties()->bitsPerSample());
if (file_asf->tag()) {
Decode(file_asf->tag()->comment(), nullptr, song->mutable_comment());
}
const TagLib::ASF::AttributeListMap &attributes_map = file_asf->tag()->attributeListMap(); const TagLib::ASF::AttributeListMap &attributes_map = file_asf->tag()->attributeListMap();
if (attributes_map.contains(kASF_OriginalDate_ID)) { if (attributes_map.contains(kASF_OriginalDate_ID)) {

View File

@ -1261,7 +1261,7 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) {
//EXPECT_EQ("strawberry performer", song.performer()); //EXPECT_EQ("strawberry performer", song.performer());
//EXPECT_EQ("strawberry grouping", song.grouping()); //EXPECT_EQ("strawberry grouping", song.grouping());
EXPECT_EQ("strawberry genre", song.genre()); EXPECT_EQ("strawberry genre", song.genre());
//EXPECT_EQ("strawberry comment", song.comment()); EXPECT_EQ("strawberry comment", song.comment());
//EXPECT_EQ("strawberry lyrics", song.lyrics()); //EXPECT_EQ("strawberry lyrics", song.lyrics());
EXPECT_EQ(12, song.track()); EXPECT_EQ(12, song.track());
//EXPECT_EQ(1234, song.disc()); //EXPECT_EQ(1234, song.disc());
@ -1297,7 +1297,7 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) {
//EXPECT_EQ("new performer", song.performer()); //EXPECT_EQ("new performer", song.performer());
//EXPECT_EQ("new grouping", song.grouping()); //EXPECT_EQ("new grouping", song.grouping());
EXPECT_EQ("new genre", song.genre()); EXPECT_EQ("new genre", song.genre());
//EXPECT_EQ("new comment", song.comment()); EXPECT_EQ("new comment", song.comment());
//EXPECT_EQ("new lyrics", song.lyrics()); //EXPECT_EQ("new lyrics", song.lyrics());
EXPECT_EQ(21, song.track()); EXPECT_EQ(21, song.track());
//EXPECT_EQ(4321, song.disc()); //EXPECT_EQ(4321, song.disc());
@ -1332,7 +1332,7 @@ TEST_F(TagReaderTest, TestASFAudioFileTagging) {
//EXPECT_EQ("strawberry performer", song.performer()); //EXPECT_EQ("strawberry performer", song.performer());
//EXPECT_EQ("strawberry grouping", song.grouping()); //EXPECT_EQ("strawberry grouping", song.grouping());
EXPECT_EQ("strawberry genre", song.genre()); EXPECT_EQ("strawberry genre", song.genre());
//EXPECT_EQ("strawberry comment", song.comment()); EXPECT_EQ("strawberry comment", song.comment());
//EXPECT_EQ("strawberry lyrics", song.lyrics()); //EXPECT_EQ("strawberry lyrics", song.lyrics());
EXPECT_EQ(12, song.track()); EXPECT_EQ(12, song.track());
//EXPECT_EQ(1234, song.disc()); //EXPECT_EQ(1234, song.disc());