From 6572fa8f23358724dc4730e98d233ccac3e53083 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 12 Feb 2022 17:43:20 +0100 Subject: [PATCH] The displayRelative property can now be overridden for the md_lastplayed metadata type. --- es-core/src/components/DateTimeComponent.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/es-core/src/components/DateTimeComponent.cpp b/es-core/src/components/DateTimeComponent.cpp index e4f077c2a..87e78d0f1 100644 --- a/es-core/src/components/DateTimeComponent.cpp +++ b/es-core/src/components/DateTimeComponent.cpp @@ -117,9 +117,6 @@ void DateTimeComponent::applyTheme(const std::shared_ptr& theme, if (!elem) return; - if (elem->has("displayRelative")) - setDisplayRelative(elem->get("displayRelative")); - if (elem->has("format")) setFormat(elem->get("format")); @@ -178,6 +175,12 @@ void DateTimeComponent::applyTheme(const std::shared_ptr& theme, if (properties & METADATA && elem->has("metadata")) setMetadataField(elem->get("metadata")); + if (mMetadataField == "md_lastplayed") + setDisplayRelative(true); + + if (elem->has("displayRelative")) + setDisplayRelative(elem->get("displayRelative")); + if (properties & LETTER_CASE && elem->has("letterCase")) { std::string letterCase {elem->get("letterCase")}; if (letterCase == "uppercase") {