1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-06 03:50:06 +02:00

Use PacketType instead of hex identifiers

This commit is contained in:
Roderick van Domburg 2021-06-22 23:57:38 +02:00
parent 4fe1183a80
commit 0703630041
No known key found for this signature in database
GPG key ID: 7076AA781B43EFE6
12 changed files with 160 additions and 42 deletions

View file

@ -7,6 +7,7 @@ use byteorder::{BigEndian, WriteBytesExt};
use bytes::Bytes;
use futures_util::StreamExt;
use librespot_core::channel::{Channel, ChannelData};
use librespot_core::packet::PacketType;
use librespot_core::session::Session;
use librespot_core::spotify_id::FileId;
use tempfile::NamedTempFile;
@ -46,7 +47,7 @@ pub fn request_range(session: &Session, file: FileId, offset: usize, length: usi
data.write_u32::<BigEndian>(start as u32).unwrap();
data.write_u32::<BigEndian>(end as u32).unwrap();
session.send_packet(0x8, data);
session.send_packet(PacketType::StreamChunk, data);
channel
}