Skip to content

Commit

Permalink
Merge remote-tracking branch 'fork/dev' into integrate-dealer
Browse files Browse the repository at this point in the history
# Conflicts:
#	Cargo.lock
#	connect/src/spirc.rs
#	core/src/spclient.rs
#   src/main.rs
  • Loading branch information
photovoltex committed Oct 28, 2024
2 parents dde7102 + f96f36c commit dc831d0
Show file tree
Hide file tree
Showing 37 changed files with 2,247 additions and 784 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG debian_version=slim-bookworm
ARG rust_version=1.74.0
ARG rust_version=1.75.0
FROM rust:${rust_version}-${debian_version}

ARG DEBIAN_FRONTEND=noninteractive
Expand Down
29 changes: 20 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,33 @@ assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.
### Look for similar bugs
Please check if there's [already an issue](https://github.com/librespot-org/librespot/issues) for your problem.
If you've only a "me too" comment to make, consider if a :+1: [reaction](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/)
will suffice.

**To reproduce**
Steps to reproduce the behavior:
### Description
A clear and concise description of what the problem is.

### Version
What version(s) of *librespot* does this problem exist in?

### How to reproduce
Steps to reproduce the behavior in *librespot* e.g.
1. Launch `librespot` with '...'
2. Connect with '...'
3. In the client click on '...'
4. See error
4. See some error/problem

**Log**
A full log so we may trace your problem (launch `librespot` with `--verbose`). Format the log as code.
### Log
* A *full* **debug** log so we may trace your problem (launch `librespot` with `--verbose`).
* Ideally contains your above steps to reproduce.
* Format the log as code ([help](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks)) or use a *non-expiring* [pastebin](https://pastebin.com/).
* Redact data you consider personal but do not remove/trim anything else.

**Host (what you are running `librespot` on):**
### Host (what you are running `librespot` on):
- OS: [e.g. Linux]
- Platform: [e.g. RPi 3B+]

**Additional context**
### Additional context
Add any other context about the problem here. If your issue is related to sound playback, at a minimum specify the type and make of your output device.
24 changes: 12 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2
- name: Install toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- --profile default --default-toolchain stable -y
- run: cargo fmt --all -- --check
Expand All @@ -68,7 +68,7 @@ jobs:
toolchain: [stable]
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Install toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- --profile default --default-toolchain ${{ matrix.toolchain }} -y
Expand All @@ -79,7 +79,7 @@ jobs:
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.2
with:
path: |
~/.cargo/registry/index
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
matrix:
os: [ubuntu-latest]
toolchain:
- "1.74" # MSRV (Minimum supported rust version)
- "1.75" # MSRV (Minimum supported rust version)
- stable
experimental: [false]
# Ignore failures in beta
Expand All @@ -119,7 +119,7 @@ jobs:
experimental: true
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Install toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain ${{ matrix.toolchain }} -y
Expand All @@ -130,7 +130,7 @@ jobs:
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.2
with:
path: |
~/.cargo/registry/index
Expand Down Expand Up @@ -164,11 +164,11 @@ jobs:
matrix:
os: [windows-latest]
toolchain:
- "1.74" # MSRV (Minimum supported rust version)
- "1.75" # MSRV (Minimum supported rust version)
- stable
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

# hyper-rustls >=0.27 uses aws-lc as default backend which requires NASM to build
- name: Install NASM
Expand All @@ -183,7 +183,7 @@ jobs:
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.2
with:
path: |
~/.cargo/registry/index
Expand Down Expand Up @@ -215,11 +215,11 @@ jobs:
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
toolchain:
- "1.74" # MSRV (Minimum supported rust version)
- "1.75" # MSRV (Minimum supported rust version)
- stable
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

- name: Install toolchain
run: curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain ${{ matrix.toolchain }} -y
Expand All @@ -230,7 +230,7 @@ jobs:
shell: bash

- name: Cache Rust dependencies
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.2
with:
path: |
~/.cargo/registry/index
Expand Down
72 changes: 56 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,36 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) since v0.2.0.

## [0.5.0-dev] - YYYY-MM-DD
## [Unreleased]

This version will be a major departure from the architecture up until now. It
### Fixed

- [core] Fix "source slice length (16) does not match destination slice length
(20)" panic on some tracks

### Changed

- [core] The `access_token` for http requests is now acquired by `login5`
- [core] MSRV is now 1.75 (breaking)
- [discovery] librespot can now be compiled with multiple MDNS/DNS-SD backends
(avahi, dns_sd, libmdns) which can be selected using a CLI flag. The defaults
are unchanged (breaking).

### Added

- [core] Add `login` (mobile) and `auth_token` retrieval via login5
- [core] Add `OS` and `os_version` to `config.rs`
- [discovery] Added a new MDNS/DNS-SD backend which connects to Avahi via D-Bus.

### Removed

### Fixed

- [connect] Fixes initial volume showing zero despite playing in full volume instead

## [0.5.0] - 2024-10-15

This version is be a major departure from the architecture up until now. It
focuses on implementing the "new Spotify API". This means moving large parts
of the Spotify protocol from Mercury to HTTP. A lot of this was reverse
engineered before by @devgianlu of librespot-java. It was long overdue that we
Expand All @@ -17,7 +44,7 @@ hopefully upcoming Spotify HiFi depend on it.
Splitting up the work on the new Spotify API, v0.5.0 brings HTTP-based file
downloads and metadata access. Implementing the "dealer" (replacing the current
Mercury-based SPIRC message bus with WebSockets, also required for social plays)
is separate large effort, to be targeted for v0.6.0.
is a large and separate effort, slated for some later release.

While at it, we are taking the liberty to do some major refactoring to make
librespot more robust. Consequently not only the Spotify API changed but large
Expand All @@ -39,13 +66,15 @@ https://github.com/librespot-org/librespot
- [all] Use a single `player` instance. Eliminates occasional `player` and
`audio backend` restarts, which can cause issues with some playback
configurations.
- [all] Updated and removed unused dependencies
- [audio] Files are now downloaded over the HTTPS CDN (breaking)
- [audio] Improve file opening and seeking performance (breaking)
- [core] MSRV is now 1.74 (breaking)
- [connect] `DeviceType` moved out of `connect` into `core` (breaking)
- [connect] Update and expose all `spirc` context fields (breaking)
- [connect] Add `Clone, Defaut` traits to `spirc` contexts
- [connect] Autoplay contexts are now retrieved with the `spclient` (breaking)
- [contrib] Updated Docker image
- [core] Message listeners are registered before authenticating. As a result
there now is a separate `Session::new` and subsequent `session.connect`.
(breaking)
Expand All @@ -56,7 +85,10 @@ https://github.com/librespot-org/librespot
- [core] `FileId` is moved out of `SpotifyId`. For now it will be re-exported.
- [core] Report actual platform data on login
- [core] Support `Session` authentication with a Spotify access token
- [core] `Credentials.username` is now an `Option` (breaking)
- [core] `Credentials.username` is now an `Option` (breaking)
- [core] `Session::connect` tries multiple access points, retrying each one.
- [core] Each access point connection now timesout after 3 seconds.
- [core] Listen on both IPV4 and IPV6 on non-windows hosts
- [main] `autoplay {on|off}` now acts as an override. If unspecified, `librespot`
now follows the setting in the Connect client that controls it. (breaking)
- [metadata] Most metadata is now retrieved with the `spclient` (breaking)
Expand All @@ -74,6 +106,7 @@ https://github.com/librespot-org/librespot

- [all] Check that array indexes are within bounds (panic safety)
- [all] Wrap errors in librespot `Error` type (breaking)
- [audio] Make audio fetch parameters tunable
- [connect] Add option on which zeroconf will bind. Defaults to all interfaces. Ignored by DNS-SD.
- [connect] Add session events
- [connect] Add `repeat`, `set_position_ms` and `set_volume` to `spirc.rs`
Expand All @@ -93,6 +126,8 @@ https://github.com/librespot-org/librespot
- [core] Support parsing `SpotifyId` for local files
- [core] Support parsing `SpotifyId` for named playlists
- [core] Add checks and handling for stale server connections.
- [core] Fix potential deadlock waiting for audio decryption keys.
- [discovery] Add option to show playback device as a group
- [main] Add all player events to `player_event_handler.rs`
- [main] Add an event worker thread that runs async to the main thread(s) but
sync to itself to prevent potential data races for event consumers
Expand All @@ -116,11 +151,15 @@ https://github.com/librespot-org/librespot
- [connect] Loading previous or next tracks, or looping back on repeat, will
only start playback when we were already playing
- [connect, playback] Clean up and de-noise events and event firing
- [core] Fixed frequent disconnections for some users
- [core] More strict Spotify ID parsing
- [discovery] Update active user field upon connection
- [playback] Handle invalid track start positions by just starting the track
from the beginning
- [playback] Handle disappearing and invalid devices better
- [playback] Handle seek, pause, and play commands while loading
- [playback] Handle disabled normalisation correctly when using fixed volume
- [playback] Do not stop sink in gapless mode
- [metadata] Fix missing colon when converting named spotify IDs to URIs

## [0.4.2] - 2022-07-29
Expand Down Expand Up @@ -282,16 +321,17 @@ v0.4.x as a stable branch until then.

## [0.1.0] - 2019-11-06

[0.5.0-dev]: https://github.com/librespot-org/librespot/compare/v0.4.1..HEAD
[0.4.2]: https://github.com/librespot-org/librespot/compare/v0.4.1..v0.4.2
[0.4.1]: https://github.com/librespot-org/librespot/compare/v0.4.0..v0.4.1
[0.4.0]: https://github.com/librespot-org/librespot/compare/v0.3.1..v0.4.0
[0.3.1]: https://github.com/librespot-org/librespot/compare/v0.3.0..v0.3.1
[0.3.0]: https://github.com/librespot-org/librespot/compare/v0.2.0..v0.3.0
[0.2.0]: https://github.com/librespot-org/librespot/compare/v0.1.6..v0.2.0
[0.1.6]: https://github.com/librespot-org/librespot/compare/v0.1.5..v0.1.6
[0.1.5]: https://github.com/librespot-org/librespot/compare/v0.1.3..v0.1.5
[0.1.3]: https://github.com/librespot-org/librespot/compare/v0.1.2..v0.1.3
[0.1.2]: https://github.com/librespot-org/librespot/compare/v0.1.1..v0.1.2
[0.1.1]: https://github.com/librespot-org/librespot/compare/v0.1.0..v0.1.1
[unreleased]: https://github.com/librespot-org/librespot/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/librespot-org/librespot/compare/v0.4.2...v0.5.0
[0.4.2]: https://github.com/librespot-org/librespot/compare/v0.4.1...v0.4.2
[0.4.1]: https://github.com/librespot-org/librespot/compare/v0.4.0...v0.4.1
[0.4.0]: https://github.com/librespot-org/librespot/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/librespot-org/librespot/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/librespot-org/librespot/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/librespot-org/librespot/compare/v0.1.6...v0.2.0
[0.1.6]: https://github.com/librespot-org/librespot/compare/v0.1.5...v0.1.6
[0.1.5]: https://github.com/librespot-org/librespot/compare/v0.1.3...v0.1.5
[0.1.3]: https://github.com/librespot-org/librespot/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/librespot-org/librespot/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/librespot-org/librespot/compare/v0.1.0...v0.1.1
[0.1.0]: https://github.com/librespot-org/librespot/releases/tag/v0.1.0
11 changes: 11 additions & 0 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ On Fedora systems:
sudo dnf install alsa-lib-devel
```

### Zeroconf library dependencies
Depending on the chosen backend, specific development libraries are required.

*_Note this is an non-exhaustive list, open a PR to add to it!_*

| Zeroconf backend | Debian/Ubuntu | Fedora | macOS |
|--------------------|------------------------------|-----------------------------------|-------------|
|avahi | | | |
|dns_sd | `libavahi-compat-libdnssd-dev pkg-config` | `avahi-compat-libdns_sd-devel` | |
|libmdns (default) | | | |

### Getting the Source

The recommended method is to first fork the repo, so that you have a copy that you have read/write access to. After that, it’s a simple case of cloning your fork.
Expand Down
Loading

0 comments on commit dc831d0

Please sign in to comment.