removed dates on episodes and seasons and songs
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -799,10 +799,19 @@ fn render_library(
|
||||
|
||||
let (start, end) = compute_window(len, selected, viewport);
|
||||
|
||||
fn show_year_for(item_type: Option<&str>) -> bool {
|
||||
matches!(item_type, Some("Movie" | "Series" | "MusicAlbum"))
|
||||
}
|
||||
|
||||
let list_items: Vec<ListItem> = items[start..end]
|
||||
.iter()
|
||||
.map(|it| {
|
||||
let year = it.production_year.map(|y| format!(" ({y})")).unwrap_or_default();
|
||||
let year = if show_year_for(it.item_type.as_deref()) {
|
||||
it.production_year.map(|y| format!(" ({y})")).unwrap_or_default()
|
||||
} else {
|
||||
String::new()
|
||||
};
|
||||
|
||||
ListItem::new(format!("{}{}", it.name, year))
|
||||
})
|
||||
.collect();
|
||||
|
||||
Reference in New Issue
Block a user