pinakes-ui: streamline sidebar design
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I0176fa480e5ba40eea5a39685a4f97896a6a6964
This commit is contained in:
parent
3e14bbe607
commit
278bcaa4b0
25 changed files with 1805 additions and 1686 deletions
|
|
@ -293,9 +293,10 @@ impl TranscodeService {
|
|||
|
||||
// Clean up cache directory
|
||||
if let Some(path) = cache_path
|
||||
&& let Err(e) = tokio::fs::remove_dir_all(&path).await {
|
||||
tracing::error!("failed to remove transcode cache directory: {}", e);
|
||||
}
|
||||
&& let Err(e) = tokio::fs::remove_dir_all(&path).await
|
||||
{
|
||||
tracing::error!("failed to remove transcode cache directory: {}", e);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
@ -311,9 +312,10 @@ impl TranscodeService {
|
|||
.iter()
|
||||
.filter_map(|(id, sess)| {
|
||||
if let Some(expires) = sess.expires_at
|
||||
&& now > expires {
|
||||
return Some((*id, sess.cache_path.clone()));
|
||||
}
|
||||
&& now > expires
|
||||
{
|
||||
return Some((*id, sess.cache_path.clone()));
|
||||
}
|
||||
None
|
||||
})
|
||||
.collect();
|
||||
|
|
@ -475,21 +477,22 @@ async fn run_ffmpeg(
|
|||
while let Ok(Some(line)) = lines.next_line().await {
|
||||
// FFmpeg progress output: "out_time_us=12345678"
|
||||
if let Some(time_str) = line.strip_prefix("out_time_us=")
|
||||
&& let Ok(us) = time_str.trim().parse::<f64>() {
|
||||
let secs = us / 1_000_000.0;
|
||||
// Calculate progress based on known duration
|
||||
let progress = match duration_secs {
|
||||
Some(dur) if dur > 0.0 => (secs / dur).min(0.99) as f32,
|
||||
_ => {
|
||||
// Duration unknown; don't update progress
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let mut s = sessions.write().await;
|
||||
if let Some(sess) = s.get_mut(&session_id) {
|
||||
sess.progress = progress;
|
||||
&& let Ok(us) = time_str.trim().parse::<f64>()
|
||||
{
|
||||
let secs = us / 1_000_000.0;
|
||||
// Calculate progress based on known duration
|
||||
let progress = match duration_secs {
|
||||
Some(dur) if dur > 0.0 => (secs / dur).min(0.99) as f32,
|
||||
_ => {
|
||||
// Duration unknown; don't update progress
|
||||
continue;
|
||||
}
|
||||
};
|
||||
let mut s = sessions.write().await;
|
||||
if let Some(sess) = s.get_mut(&session_id) {
|
||||
sess.progress = progress;
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue