feat: show YouTube videos as two-line entries
This commit is contained in:
+33
-25
@@ -101,7 +101,7 @@
|
||||
//! Switching views cancels in-flight extraction; returning retains the unaccepted request and per-channel offsets.
|
||||
//! Errors keep loaded rows and stop automatic retries; r reloads config and restarts the current view.
|
||||
//! Deep pages may slow down because yt-dlp offsets re-traverse earlier continuation pages.
|
||||
//! Video tables show Published as YYYY-MM-DD; ~ marks estimated UTC dates, Unknown missing metadata.
|
||||
//! Video entries show the title above channel · YYYY-MM-DD; ~ marks estimated UTC dates, Unknown missing metadata.
|
||||
//! Prefer exact upload dates and cache date labels during extraction, not on every redraw.
|
||||
//! Terebi receives `--new-instance --url` and a private `--progress-file`; each selection gets its own player.
|
||||
//! `--player` overrides its CLI path; otherwise `terebi` is resolved through PATH.
|
||||
@@ -2986,39 +2986,47 @@ impl App {
|
||||
.categories
|
||||
.values()
|
||||
.any(|channels| video_in_channels(video, channels, &self.config));
|
||||
let channel = Cell::from(video.channel.as_deref().unwrap_or("Unknown"));
|
||||
let title = Span::raw(video.title.as_str());
|
||||
let channel = Span::raw(video.channel.as_deref().unwrap_or("Unknown"));
|
||||
Row::new([
|
||||
Cell::from(if self.video_state.is_watched(&video.id) {
|
||||
"✓"
|
||||
} else {
|
||||
""
|
||||
}),
|
||||
if self.video_state.contains(CollectionKind::Saved, &video.id) {
|
||||
Cell::from(video.title.as_str()).fg(Color::Green)
|
||||
} else if self
|
||||
.video_state
|
||||
.contains(CollectionKind::WatchLater, &video.id)
|
||||
{
|
||||
Cell::from(video.title.as_str()).fg(Color::Magenta)
|
||||
} else {
|
||||
Cell::from(video.title.as_str())
|
||||
},
|
||||
if tagged {
|
||||
channel.fg(Color::Cyan)
|
||||
} else {
|
||||
channel
|
||||
},
|
||||
Cell::from(video.publication_date.as_deref().unwrap_or("Unknown")),
|
||||
Cell::from(Text::from(vec![
|
||||
Line::from(
|
||||
if self.video_state.contains(CollectionKind::Saved, &video.id) {
|
||||
title.fg(Color::Green)
|
||||
} else if self
|
||||
.video_state
|
||||
.contains(CollectionKind::WatchLater, &video.id)
|
||||
{
|
||||
title.fg(Color::Magenta)
|
||||
} else {
|
||||
title
|
||||
},
|
||||
),
|
||||
Line::from(vec![
|
||||
if tagged {
|
||||
channel.fg(Color::Cyan)
|
||||
} else {
|
||||
channel
|
||||
},
|
||||
" · ".into(),
|
||||
video
|
||||
.publication_date
|
||||
.as_deref()
|
||||
.unwrap_or("Unknown")
|
||||
.into(),
|
||||
])
|
||||
.dim(),
|
||||
])),
|
||||
])
|
||||
.height(2)
|
||||
}),
|
||||
[
|
||||
Constraint::Length(1),
|
||||
Constraint::Fill(3),
|
||||
Constraint::Fill(1),
|
||||
Constraint::Length(11),
|
||||
],
|
||||
[Constraint::Length(1), Constraint::Fill(1)],
|
||||
)
|
||||
.header(Row::new(["", "Video", "Channel", "Published"]).bold())
|
||||
.block(Block::bordered().title(loading_title(
|
||||
if view.source == ViewSource::Search {
|
||||
" Results "
|
||||
|
||||
Reference in New Issue
Block a user