|
@ -94,7 +94,6 @@ class ContentMetadataFields(enum.Enum): |
|
|
PUBLISHED = enum.auto() |
|
|
PUBLISHED = enum.auto() |
|
|
TITLE = enum.auto() |
|
|
TITLE = enum.auto() |
|
|
WORD_COUNT = enum.auto() |
|
|
WORD_COUNT = enum.auto() |
|
|
TIME_TO_READ = enum.auto() |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
@property |
|
|
def key(self) -> str: |
|
|
def key(self) -> str: |
|
@ -113,10 +112,10 @@ class ContentMetadataFields(enum.Enum): |
|
|
) -> list["ContentMetadataFields"]: |
|
|
) -> list["ContentMetadataFields"]: |
|
|
"""Return a list of fields to display for detail about a particular type.""" |
|
|
"""Return a list of fields to display for detail about a particular type.""" |
|
|
if content_type is TopicContentType.ARTICLE: |
|
|
if content_type is TopicContentType.ARTICLE: |
|
|
return [cls.WORD_COUNT, cls.TIME_TO_READ, cls.PUBLISHED] |
|
|
|
|
|
|
|
|
return [cls.WORD_COUNT, cls.PUBLISHED] |
|
|
|
|
|
|
|
|
if content_type is TopicContentType.TEXT: |
|
|
if content_type is TopicContentType.TEXT: |
|
|
return [cls.WORD_COUNT, cls.TIME_TO_READ] |
|
|
|
|
|
|
|
|
return [cls.WORD_COUNT] |
|
|
|
|
|
|
|
|
if content_type is TopicContentType.VIDEO: |
|
|
if content_type is TopicContentType.VIDEO: |
|
|
return [cls.DURATION, cls.PUBLISHED] |
|
|
return [cls.DURATION, cls.PUBLISHED] |
|
@ -156,9 +155,6 @@ class ContentMetadataFields(enum.Enum): |
|
|
|
|
|
|
|
|
return f"{word_count} words" |
|
|
return f"{word_count} words" |
|
|
|
|
|
|
|
|
if self.name == "TIME_TO_READ": |
|
|
|
|
|
return f"{value:.1f} minutes" |
|
|
|
|
|
|
|
|
|
|
|
return str(value) |
|
|
return str(value) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|