Update audio to hyper 1.x

This commit is contained in:
George Hahn 2024-06-06 01:41:48 -06:00
parent 0a7a874ca0
commit 6a4053e871
4 changed files with 9 additions and 4 deletions

1
Cargo.lock generated
View file

@ -1424,6 +1424,7 @@ dependencies = [
"ctr",
"futures-core",
"futures-util",
"http-body-util",
"hyper",
"hyper-util",
"librespot-core",

View file

@ -19,7 +19,9 @@ bytes = "1"
ctr = "0.9"
futures-core = "0.3"
futures-util = "0.3"
hyper = { version = "0.14", features = ["client", "backports", "deprecated"] }
hyper = { version = "1.3", features = [] }
hyper-util = { version = "0.1", features = ["client"] }
http-body-util = "0.1.1"
log = "0.4"
parking_lot = { version = "0.12", features = ["deadlock_detection"] }
tempfile = "3"

View file

@ -12,7 +12,8 @@ use std::{
};
use futures_util::{future::IntoStream, StreamExt, TryFutureExt};
use hyper::{client::ResponseFuture, header::CONTENT_RANGE, Body, Response, StatusCode};
use hyper::{body::Incoming, header::CONTENT_RANGE, Response, StatusCode};
use hyper_util::client::legacy::ResponseFuture;
use parking_lot::{Condvar, Mutex};
use tempfile::NamedTempFile;
use thiserror::Error;
@ -133,7 +134,7 @@ pub enum AudioFile {
#[derive(Debug)]
pub struct StreamingRequest {
streamer: IntoStream<ResponseFuture>,
initial_response: Option<Response<Body>>,
initial_response: Option<Response<Incoming>>,
offset: usize,
length: usize,
}

View file

@ -7,9 +7,10 @@ use std::{
use bytes::Bytes;
use futures_util::StreamExt;
use hyper::{body::HttpBody, StatusCode};
use hyper::StatusCode;
use tempfile::NamedTempFile;
use tokio::sync::{mpsc, oneshot};
use http_body_util::BodyExt;
use librespot_core::{http_client::HttpClient, session::Session, Error};