feat(lib): carry audio attributes in browse and folder listings
A browse listed each file as a name and a size, so a searcher who saw a bitrate in a search reply lost it the moment they opened the sharer's files. Listings (codes 5 and 37) now carry each file's attributes the way Nicotine+ sends them, as a SharedFileEntry with name, size and attributes in place of the (name, size) pair; the CLI's browse record gains bitrate and duration, and the daemon protocol moves to version 2 for the new listing shape.
This commit is contained in:
@@ -100,11 +100,10 @@ fn tick_reaps_a_peer_idle_past_the_deadline() {
|
||||
/// ticks proves the actor drains the socket rather than sipping 1 KiB a tick.
|
||||
fn big_listing() -> Vec<u8> {
|
||||
let files = (0..400u64)
|
||||
.map(|i| {
|
||||
(
|
||||
format!("track-{i:03}-{}.flac", "x".repeat(i as usize % 17)),
|
||||
i,
|
||||
)
|
||||
.map(|i| crate::message::peer::SharedFileEntry {
|
||||
name: format!("track-{i:03}-{}.flac", "x".repeat(i as usize % 17)),
|
||||
size: i,
|
||||
attributes: Vec::new(),
|
||||
})
|
||||
.collect();
|
||||
let dir = crate::message::peer::SharedDirectory {
|
||||
|
||||
Reference in New Issue
Block a user