mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[PR #580] [CLOSED] Refactor volume and cache #978
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#978
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/580
Author: @Johannesd3
Created: 1/25/2021
Status: ❌ Closed
Base:
dev← Head:refactor_cache📝 Commits (5)
8ebd482Use Volume struct throughout5082642Refactored Cache48e9b32Made locations in cache optional9749869Giving meaning to the Volume structea1b87cFix alsa mixer📊 Changes
13 files changed (+1493 additions, -1495 deletions)
View changed files
📝
Cargo.lock(+1263 -1305)📝
audio/src/fetch.rs(+1 -1)📝
connect/src/spirc.rs(+7 -37)📝
core/src/authentication.rs(+1 -28)📝
core/src/cache.rs(+107 -76)📝
core/src/config.rs(+3 -3)📝
core/src/volume.rs(+65 -22)📝
playback/Cargo.toml(+1 -1)📝
playback/src/mixer/alsamixer.rs(+3 -2)📝
playback/src/mixer/mod.rs(+3 -1)📝
playback/src/mixer/softmixer.rs(+4 -2)📝
playback/src/player.rs(+4 -4)📝
src/main.rs(+31 -13)📄 Description
This PR suggest a refactor of Volume and Cache.
It replaces many occurences of
u16byVolume, which is a little used newtype foru16. (This would change public api in some places, but it could be easily reverted if it's not considered worth a breaking change).The
Cachewas refactored completely. The logic to store and readVolumeandCredentialsin/from files was moved toCache, which makes those independent fromstd::fsandstd::io. As it is now possible to split audio and system cache, the paths instruct Cachewere made optional. Also, error handling and logging was improved. It contains breaking changes as well, but there were also some in previous PRs.I removed the additions made by #518, but if you're in favour of this PR, I would add them again before it is merged.
It would fix #578 by the way.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.