Add support for displaying lyrics from a Vorbis comment (#5495)
* Added support for displaying lyrics from Vorbis Comments. * Fixed style issues
This commit is contained in:
parent
e5ab3e786f
commit
622a3e478a
|
@ -568,6 +568,11 @@ void TagReader::ParseOggTag(const TagLib::Ogg::FieldListMap& map,
|
|||
.trimmed()
|
||||
.toFloat() *
|
||||
100);
|
||||
|
||||
if (!map["LYRICS"].isEmpty())
|
||||
Decode(map["LYRICS"].front(), codec, song->mutable_lyrics());
|
||||
else if (!map["UNSYNCEDLYRICS"].isEmpty())
|
||||
Decode(map["UNSYNCEDLYRICS"].front(), codec, song->mutable_lyrics());
|
||||
}
|
||||
|
||||
void TagReader::SetVorbisComments(
|
||||
|
@ -593,9 +598,15 @@ void TagReader::SetVorbisComments(
|
|||
true);
|
||||
|
||||
// Try to be coherent, the two forms are used but the first one is preferred
|
||||
|
||||
vorbis_comments->addField("ALBUMARTIST",
|
||||
StdStringToTaglibString(song.albumartist()), true);
|
||||
vorbis_comments->removeField("ALBUM ARTIST");
|
||||
|
||||
vorbis_comments->addField("LYRICS",
|
||||
StdStringToTaglibString(song.lyrics()), true);
|
||||
vorbis_comments->removeField("UNSYNCEDLYRICS");
|
||||
|
||||
}
|
||||
|
||||
void TagReader::SetFMPSStatisticsVorbisComments(
|
||||
|
|
|
@ -26,7 +26,7 @@ void TagLyricsInfoProvider::FetchInfo(int id, const Song& metadata) {
|
|||
if (!lyrics.isEmpty()) {
|
||||
CollapsibleInfoPane::Data data;
|
||||
data.id_ = "tag/lyrics";
|
||||
data.title_ = tr("Lyrics from the ID3v2 tag");
|
||||
data.title_ = tr("Lyrics from the tag");
|
||||
data.type_ = CollapsibleInfoPane::Data::Type_Lyrics;
|
||||
|
||||
SongInfoTextView* editor = new SongInfoTextView;
|
||||
|
|
Loading…
Reference in New Issue