mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #673] [MERGED] Create separate discovery crate #1011
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#1011
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/librespot-org/librespot/pull/673
Author: @Johannesd3
Created: 3/14/2021
Status: ✅ Merged
Merged: 5/26/2021
Merged by: @roderickvd
Base:
dev← Head:discovery-crate📝 Commits (8)
ebea539Add librespot-discovery crate1ec5dd2Add discovery examplea7f9e0aAdd an error type to librespot_discovery16de6a7Improve api of discovery crate's builderc49e132Update workflow9b6ba49Add "discovery" compat layer to "connect"ceab363Update changelog4448ce0Set correct libraryVersion📊 Changes
14 files changed (+583 additions, -298 deletions)
View changed files
📝
.github/workflows/test.yml(+2 -2)📝
CHANGELOG.md(+7 -1)📝
Cargo.lock(+51 -9)📝
Cargo.toml(+5 -1)📝
connect/Cargo.toml(+7 -14)📝
connect/src/discovery.rs(+15 -247)📝
connect/src/lib.rs(+4 -0)📝
core/src/config.rs(+35 -22)➕
discovery/Cargo.toml(+40 -0)➕
discovery/examples/discovery.rs(+25 -0)➕
discovery/src/lib.rs(+150 -0)➕
discovery/src/server.rs(+236 -0)📝
src/lib.rs(+1 -0)📝
src/main.rs(+5 -2)📄 Description
This PR splits out a new
librespot-discoverycrate out oflibrespot-connect. The original rationale was the fact that discovery and spirc don't have many dependencies in common. Probably they only belong to the same crate because Spotify sells them as one feature.However, after the split was done, I wondered how the new crate could be improved and extended.
There might be other endpoints that we (at least I) don't know of, or they might be added in future, so my first aim was to make it easy to add them. I also thought of the possibility to add a client functionality to this crate. Therefore, I decided to create slightly overengineeredSerializeandDeserializeimplementations for arguments and responses. Those can be found in the modulesrequestandresponse. I added unit tests to handle the additional complexity.I tried to create a neat API surface, and added documentation for all public items.
I don't want this to get merged before #665 is merged into dev, so I keep it as a draft for now. But I'd really like to hear you feedback before I continue working on it. Do you think it is a worthwhile change, or is it getting too complicated?This change is not breaking: The module
librespot_connect::discoveryremains as a compatibility layer for the new crate and will be deprecated. This module could be removed in a later breaking release.PS: There's one concrete improvement: The server does not panic anymore on certain malformed requests.Future possibilites
EDIT: After removing commit e3e60bb, most things don't apply anymore. It would be just a step into this direction.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.