mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-05 12:56:52 +01:00
TagLib MP4 - setTrack()/setYear() accepts 0 to remove the tag
This commit is contained in:
parent
5a490a8b5a
commit
114f862ea4
10
3rdparty/taglib/mp4/mp4tag.cpp
vendored
10
3rdparty/taglib/mp4/mp4tag.cpp
vendored
@ -805,14 +805,24 @@ MP4::Tag::setGenre(const String &value)
|
||||
void
|
||||
MP4::Tag::setYear(unsigned int value)
|
||||
{
|
||||
if (value == 0) {
|
||||
d->items.erase("\251day");
|
||||
}
|
||||
else {
|
||||
d->items["\251day"] = StringList(String::number(value));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MP4::Tag::setTrack(unsigned int value)
|
||||
{
|
||||
if (value == 0) {
|
||||
d->items.erase("trkn");
|
||||
}
|
||||
else {
|
||||
d->items["trkn"] = MP4::Item(value, 0);
|
||||
}
|
||||
}
|
||||
|
||||
bool MP4::Tag::isEmpty() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user