From 8fcc8e8b14806fa756ced704f0e41c6dd8e88e4d Mon Sep 17 00:00:00 2001 From: Deimos Date: Fri, 1 Feb 2019 18:12:00 -0700 Subject: [PATCH] Move duration before published date This is more consistent with word count being first. --- tildes/tildes/models/topic/topic.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tildes/tildes/models/topic/topic.py b/tildes/tildes/models/topic/topic.py index dfdcded..d4d56a9 100644 --- a/tildes/tildes/models/topic/topic.py +++ b/tildes/tildes/models/topic/topic.py @@ -388,6 +388,12 @@ class Topic(DatabaseModel): metadata_strings.append(f"{word_count} words") if self.is_link_type: + # display the duration if we have it + duration = self.get_content_metadata("duration") + if duration: + duration_delta = timedelta(seconds=duration) + metadata_strings.append(str(duration_delta).lstrip("0:")) + # display the published date if it's more than 3 days before the topic published_timestamp = self.get_content_metadata("published") if published_timestamp: @@ -395,12 +401,6 @@ class Topic(DatabaseModel): if self.created_time - published > timedelta(days=3): metadata_strings.append(published.strftime("%b %-d %Y")) - # display the duration if we have it - duration = self.get_content_metadata("duration") - if duration: - duration_delta = timedelta(seconds=duration) - metadata_strings.append(str(duration_delta).lstrip("0:")) - return ", ".join(metadata_strings) @property