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:
Michel de Graaf
2026-09-08 01:44:49 +02:00
parent 5a20d69056
commit f6423a2ed6
20 changed files with 307 additions and 95 deletions
+42 -15
View File
@@ -948,21 +948,8 @@
"SharedDirectoryDto": {
"properties": {
"files": {
"description": "Basename and size; join with the directory to get a downloadable path.",
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"type": "string"
},
{
"format": "uint64",
"minimum": 0,
"type": "integer"
}
],
"type": "array"
"$ref": "#/components/schemas/SharedFileEntryDto"
},
"type": "array"
},
@@ -976,6 +963,46 @@
],
"type": "object"
},
"SharedFileEntryDto": {
"properties": {
"attributes": {
"description": "`(code, value)` audio attributes the owner advertises.",
"items": {
"maxItems": 2,
"minItems": 2,
"prefixItems": [
{
"format": "uint32",
"minimum": 0,
"type": "integer"
},
{
"format": "uint32",
"minimum": 0,
"type": "integer"
}
],
"type": "array"
},
"type": "array"
},
"name": {
"description": "Basename; join with the directory to get a downloadable path.",
"type": "string"
},
"size": {
"format": "uint64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"name",
"size",
"attributes"
],
"type": "object"
},
"SharesStatus": {
"description": "What the share index holds, from `shares.status` / `shares.reindex`.",
"properties": {
@@ -1313,7 +1340,7 @@
"name": "MIT"
},
"title": "soulseek-rs daemon",
"version": "1"
"version": "2"
},
"methods": [
{