fix: human-readable watch medium labels in classic HTML (Media Server, Physical Media)
This commit is contained in:
@@ -43,7 +43,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% if let Some(wm) = entry.review().watch_medium() %}
|
{% if let Some(wm) = entry.review().watch_medium() %}
|
||||||
<span class="watch-medium">{{ wm }}</span>
|
<span class="watch-medium">{{ wm.label() }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if let Some(comment) = entry.review().comment() %}
|
{% if let Some(comment) = entry.review().comment() %}
|
||||||
<div class="comment">{{ comment.value() }}</div>
|
<div class="comment">{{ comment.value() }}</div>
|
||||||
|
|||||||
@@ -28,6 +28,20 @@ impl fmt::Display for WatchMedium {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl WatchMedium {
|
||||||
|
pub fn label(&self) -> &'static str {
|
||||||
|
match self {
|
||||||
|
Self::Cinema => "Cinema",
|
||||||
|
Self::Streaming => "Streaming",
|
||||||
|
Self::TV => "TV",
|
||||||
|
Self::PhysicalMedia => "Physical Media",
|
||||||
|
Self::Download => "Download",
|
||||||
|
Self::MediaServer => "Media Server",
|
||||||
|
Self::Other => "Other",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl FromStr for WatchMedium {
|
impl FromStr for WatchMedium {
|
||||||
type Err = DomainError;
|
type Err = DomainError;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user