The displayRelative property can now be overridden for the md_lastplayed metadata type.

This commit is contained in:
Leon Styhre 2022-02-12 17:43:20 +01:00
parent 69c1a1259d
commit 6572fa8f23

View file

@ -117,9 +117,6 @@ void DateTimeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (!elem)
return;
if (elem->has("displayRelative"))
setDisplayRelative(elem->get<bool>("displayRelative"));
if (elem->has("format"))
setFormat(elem->get<std::string>("format"));
@ -178,6 +175,12 @@ void DateTimeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (properties & METADATA && elem->has("metadata"))
setMetadataField(elem->get<std::string>("metadata"));
if (mMetadataField == "md_lastplayed")
setDisplayRelative(true);
if (elem->has("displayRelative"))
setDisplayRelative(elem->get<bool>("displayRelative"));
if (properties & LETTER_CASE && elem->has("letterCase")) {
std::string letterCase {elem->get<std::string>("letterCase")};
if (letterCase == "uppercase") {