pinakes-server: update remaining route imports and handlers

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I67206fd813d514f8903041eea0a4cd266a6a6964
This commit is contained in:
raf 2026-03-08 00:42:20 +03:00
commit eb6c0a3577
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
20 changed files with 169 additions and 87 deletions

View file

@ -98,7 +98,7 @@ pub async fn hls_variant_playlist(
);
for i in 0..num_segments.max(1) {
let seg_dur = if i == num_segments.saturating_sub(1) && duration > 0.0 {
duration - (i as f64 * segment_duration)
(i as f64).mul_add(-segment_duration, duration)
} else {
segment_duration
};
@ -143,7 +143,7 @@ pub async fn hls_segment(
if segment_path.exists() {
let data = tokio::fs::read(&segment_path).await.map_err(|e| {
ApiError(pinakes_core::error::PinakesError::InvalidOperation(
format!("failed to read segment: {}", e),
format!("failed to read segment: {e}"),
))
})?;
@ -246,7 +246,7 @@ pub async fn dash_segment(
if segment_path.exists() {
let data = tokio::fs::read(&segment_path).await.map_err(|e| {
ApiError(pinakes_core::error::PinakesError::InvalidOperation(
format!("failed to read segment: {}", e),
format!("failed to read segment: {e}"),
))
})?;