Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi Player Support #2164

Draft
wants to merge 127 commits into
base: future3/develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
c3549eb
Asking user for spotify
Groovylein Nov 30, 2021
5aaa2d1
activate spotify installation
Groovylein Nov 30, 2021
059566d
Merge branch 'future3/develop' into future3/spotify
Groovylein Dec 15, 2021
7992662
Enable spotify installation
Groovylein Dec 16, 2021
6b89ddf
Introduce default spotify folder
Groovylein Dec 16, 2021
1890016
Added information for installation
Groovylein Dec 20, 2021
32d53af
Setup librespot-java in Docker for development
pabera Dec 20, 2021
00d1ea5
Added docker for spotify development
Groovylein Dec 21, 2021
a19382b
Improve Docker file
pabera Dec 21, 2021
98cb97d
Ignore spotify config.toml file to avoid accidental credential commit
pabera Dec 21, 2021
d1536de
Create default config.toml file
pabera Dec 21, 2021
efb3590
Ignore spotify config.toml file to avoid accidental credential commit
Groovylein Dec 22, 2021
01ff28d
Delete docker.spotify.config.toml
Groovylein Dec 24, 2021
83001f7
Merge branch 'MiczFlor:future3/spotify' into future3/spotify
Groovylein Dec 24, 2021
e365417
Merge pull request #1680 from pabera/future3/spotify
Groovylein Dec 26, 2021
19ebc60
First implementation of spotify functions: play, stop, pause, prev, n…
Groovylein Dec 26, 2021
271c634
Merge branch 'future3/spotify' into future3/spotify
Groovylein Dec 26, 2021
92135e9
Merge pull request #1 from MiczFlor/future3/spotify
Groovylein Dec 26, 2021
6646f9a
Removed SpotLock
Groovylein Dec 27, 2021
6e0a3f8
Cleanup and device_info implementation
Groovylein Dec 27, 2021
5c1b84d
Playlist and volume implemented
Groovylein Dec 28, 2021
c74ead5
Added HTTP Error handling for spotify requests
Groovylein Dec 29, 2021
cbd59de
Catch other exception for spotify api
Groovylein Dec 29, 2021
81143cb
Added headers for requests calls
Groovylein Dec 29, 2021
93fc3a9
Refactored http error handling
Groovylein Jan 11, 2022
98da122
Delete json_example.json
Groovylein Jan 11, 2022
1c505b5
Spotify websocket initialization
Groovylein Jan 12, 2022
f3eeb6e
Merge branch 'future3/develop' into future3/spotify
Groovylein Jan 14, 2022
1b4b540
Bugfixing: import, paths, asyncio
Groovylein Jan 14, 2022
998ed06
Bugfixing: URL paths
Groovylein Jan 14, 2022
ade2023
Bugfixing: wait until connection to spotify api possible
Groovylein Jan 14, 2022
2b4e666
Bugfixing: Handle device_info right
Groovylein Jan 14, 2022
29cc50a
Docker adjustments
Groovylein Jan 14, 2022
d4ddadc
Adjustment in Websocket loop
Groovylein Jan 14, 2022
e1c25a7
Use JRE instead of JDE
pabera Jan 5, 2022
2d8ca15
Outsource http and ws client into own class (ws non functional!)
pabera Jan 15, 2022
a955afb
Use websocket-client and make http-client useful
pabera Jan 16, 2022
5aef09f
Reformating code
Groovylein Jan 17, 2022
6b3b6fc
Enhance spotify websocket to publish player status
Groovylein Jan 17, 2022
9928012
Fixing bugs in Contributing.md
pabera Jan 17, 2022
cbe4749
Abstract implementation of Player Factory
pabera Jan 18, 2022
e12a53b
Update factory naming
pabera Jan 19, 2022
5bf3b40
Fix builder init
pabera Jan 19, 2022
d0f64f4
Introduce PlayerStatus class and WS client for Spotify
pabera Jan 20, 2022
f7d5dff
Show Title, Album, CoverArt in webapp, prepare controls
pabera Jan 20, 2022
a75b0d2
Introduce Player Counter on React side
pabera Jan 21, 2022
df89357
Initial proposal for new player API with multi-backend handling
Jan 22, 2022
6e64466
Flake8 fixes
Groovylein Jan 28, 2022
5847dad
Flake8 fixes #2
Groovylein Jan 28, 2022
244a0cf
Reworked multi-backend proposal + AsyncIO MPD stub
Feb 2, 2022
04fc9fc
Merge pull request #1751 from ChisSoc: AsyncIO MPD player backend
Feb 6, 2022
2bf8fbc
Implement folder and album playback
Feb 8, 2022
de9cbb7
Clean up
Feb 8, 2022
90b54c4
Merge pull request #1759 from ChisSoc/future3/newplayer
Groovylein Feb 9, 2022
665a53f
Disable autoplay
Groovylein Feb 9, 2022
8db761f
First attempt Spotify Backend
Groovylein Feb 11, 2022
55d721a
Flake 8 corrections
Groovylein Feb 11, 2022
5412b59
Read mpd host config from jukebox.yaml
pabera Feb 13, 2022
ece4c2b
[Webapp] Interim MPD player adjustment to new player backend
pabera Feb 15, 2022
d47087e
Fix album decoding from URI
Feb 19, 2022
fbe43a0
Merge pull request #1767 from ChisSoc/future3/newplayer
Feb 19, 2022
c094839
Disable autoplay
Groovylein Feb 9, 2022
ecf11dc
First attempt Spotify Backend
Groovylein Feb 11, 2022
839f1ff
Flake 8 corrections
Groovylein Feb 11, 2022
c94d5db
Merge branch 'MiczFlor-future3/spotify' into future3/spotify
Groovylein Feb 24, 2022
5e3bc6d
Simplified internal Spotify URI
Groovylein Feb 24, 2022
a118f70
bugfixing connection loss of Spotify websocket
Groovylein Feb 24, 2022
d0832c9
Merge pull request #1761 from Groovylein/future3/spotify
Groovylein Feb 24, 2022
4d3c46c
Merge branch 'future3/develop' into future3/spotify
Groovylein Apr 30, 2022
731c9a9
Bugfixing: player.ctrl.list_backends show only keys
Groovylein May 1, 2022
23a0f82
Bugfixing: spotify player
Groovylein May 23, 2022
bd8af97
prepare Docker dor spotipy
Groovylein Jan 27, 2023
aa8443d
first attempt
Groovylein Jan 27, 2023
9d059b4
First successful attempt with cached data
Groovylein Feb 1, 2023
6ec73e2
Cleanup spotify player
Groovylein Apr 5, 2023
c7a3eab
Removed spotify code from playern
Groovylein Aug 4, 2023
20d7284
fist player content core
Groovylein Nov 6, 2023
6b54f47
populate content manager
Groovylein Nov 11, 2023
ef92b71
get_location for content, mpd fixes
Groovylein Nov 13, 2023
1547a42
Merge branch 'future3/develop' into future3/multi-player
Groovylein Nov 13, 2023
c8bc8c0
cleanup old player
Groovylein Nov 13, 2023
d0e851f
Update docker env
Groovylein Nov 18, 2023
fd04413
update from upstream
Groovylein Nov 18, 2023
aaa935a
update from upstream
Groovylein Nov 18, 2023
b910210
further update from upstream
Groovylein Nov 18, 2023
86e734e
correct flake8
Groovylein Nov 18, 2023
36bfd79
Fix docker; delete copy-paste-error
Groovylein Nov 18, 2023
b8fd417
Syntax error
Groovylein Nov 18, 2023
9006d6f
Added inheritance class for players
Groovylein Nov 18, 2023
5784f8d
Added missing functions for webapp
Groovylein Nov 18, 2023
3b4f448
first attempt for get_folder_content
Groovylein Dec 18, 2023
efbe969
Merge branch 'future3/develop' into future3/multi-player
Groovylein Dec 18, 2023
e85b294
Bring back spotify backend
Groovylein Dec 18, 2023
7a0d170
remove unnecessary files
Groovylein Dec 18, 2023
257d177
fix auth error during pip install in docker
Groovylein Dec 18, 2023
90cc33b
Docker bugfixing
Groovylein Dec 18, 2023
d43c6fe
implement Spotipy authentication via bottle
Groovylein Dec 21, 2023
e3ea953
Docker container for spotifyd with pulseaudio; Still problems
Groovylein Dec 28, 2023
e0faa44
Installation of spotifyd
Groovylein Jan 3, 2024
3d7195d
correct path of spotifyd config
Groovylein Jan 3, 2024
0deda1e
corrected relative path in jukebox yaml
Groovylein Jan 3, 2024
9a506f0
prepare for client_id, client_secret
Groovylein Jan 3, 2024
af3b281
extract player config into new file
Groovylein Jan 5, 2024
3e0c94a
make use of the new player.yaml
Groovylein Jan 5, 2024
8d65be3
create first basic documentation how to obtain client_id/client_secret
Groovylein Jan 5, 2024
bb24d8a
enhance installation method with client_id and client_secret
Groovylein Jan 5, 2024
f34815d
Adjust CI to handle spotify installation
Groovylein Jan 5, 2024
d24e16a
bugfixing spotifyd daemon
Groovylein Jan 6, 2024
190aaf7
Review changes
Groovylein Jan 8, 2024
2eccf39
Review changes #2
Groovylein Jan 8, 2024
633449e
Merge branch 'future3/develop' into future3/multi-player
Groovylein Jan 8, 2024
3510085
flake 8 fixes
Groovylein Jan 8, 2024
3aedd9c
reverted all spotify code; focus on multi-player
Groovylein Jan 10, 2024
8cb99d1
added missing functions to ABC
Groovylein Jan 13, 2024
afcafd1
cleanup old player calls for better development
Groovylein Jan 14, 2024
8be8ade
introduce necessary methods from abstract class
Groovylein Jan 14, 2024
e5ae214
enable read from new yaml file player.yaml
Groovylein Jan 22, 2024
3edfa67
display folder content in webapp
Groovylein Jan 31, 2024
c8f809b
enable playing from folder view
Groovylein Jan 31, 2024
fcf2ced
Make library available on webapp
Groovylein Feb 27, 2024
d38dc0c
Publish playerstatus, so that buttons work on the player
Groovylein Mar 11, 2024
d880d46
Merge branch 'future3/develop' into future3/multi-player
Groovylein Apr 9, 2024
ba72a18
Revert some changes
Groovylein Apr 16, 2024
8169592
transfer coverart_cache_manager
Groovylein Apr 23, 2024
b4ff177
<UNDER CONSTRUCTION> Status publishing via multitimer
Groovylein Apr 23, 2024
83692f1
<UNDER CONSTRUCTION> Correct status call in webapp
Groovylein May 2, 2024
42c15f4
Merge branch 'future3/develop' into future3/multi-player
Groovylein May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ services:
- PULSE_SERVER=tcp:host.docker.internal:4713
restart: unless-stopped
volumes:
- ../shared/audiofolders:/home/pi/RPi-Jukebox-RFID/shared/audiofolders
- ../shared/playlists:/home/pi/.config/mpd/playlists
- ./config/docker.pulse.mpd.conf://home/pi/.config/mpd/mpd.conf
- ../shared/audiofolders:/root/RPi-Jukebox-RFID/shared/audiofolders
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry for getting at it again, but i still think this should be ${HOME} as it is supplied as args and defaults to "root".
So right now if the user will provide different values it breaks.

- ../shared/playlists:/root/.config/mpd/playlists
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf

jukebox:
build:
Expand All @@ -41,9 +41,9 @@ services:
restart: unless-stopped
tty: true
volumes:
- ../src/jukebox:/home/pi/RPi-Jukebox-RFID/src/jukebox
- ../shared:/home/pi/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/home/pi/.config/mpd/mpd.conf
- ../src/jukebox:/root/RPi-Jukebox-RFID/src/jukebox
- ../shared:/root/RPi-Jukebox-RFID/shared
- ./config/docker.pulse.mpd.conf:/root/.config/mpd/mpd.conf
command: python run_jukebox.py

webapp:
Expand Down
4 changes: 2 additions & 2 deletions documentation/builders/spotify.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ To control the playback (spotipy), you need to create an app as Spotify develope

The spotifyd daemon is using the username and password of your Spotify account.

If the credentials changed, you can update them in the config file located at `/etc/spotifyd.conf`
If the credentials have changed, you can update them in the config file located at `/etc/spotifyd.conf`

### spotipy

Spotipy is using `client_id` and `client_secret` to controll the playback of the Phoniebox.
Spotipy is using `client_id` and `client_secret` to control the playback of the Phoniebox.

To update the credentials, please modify the file located at `~/RPi-Jukebox-RFID/shared/settings/player.yaml`

Expand Down
8 changes: 4 additions & 4 deletions installation/routines/customize_options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ _option_spotify() {
print_c "---------------------- SPOTIFY ----------------------

Installs an additional player, so that you can
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am adding this comment without having reviewed the actually player logic. We should not have different players. If a user does not install Spotify, we should still install the same player which only uses MPD.

With this logic, we would not install "an additional player" and instead, "just Spotify". But In understand that there is more to do than just providing credentials (e.g. Developer Account)

Install and configure Spoify for your Phoniebox

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really get what you mean.

The logic is:
MPD will always be installed.
The user can choose, if he wants to have an additional player (here Spotify). If he chooses "no" he will still have MPD

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's just different understand of wording. Ignore my comment for now.

play music from spotify.
play music from spotify. You will need to create
an app in the Spotify developer dashboard to use
Spotify properly

Note: You need Spotify Premium to run this service!
Note: Spotify Premium is needed to operate player!

For more information see documentation:
https://github.com/MiczFlor/RPi-Jukebox-RFID/blob/future3/develop/documentation/builders/spotify.md

Do you want to enable the spotify player? [y/N]"
read -r response
Expand Down
1 change: 0 additions & 1 deletion installation/routines/setup_spotify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ _spotifyd_check() {
verify_files_exists "${SPOTIFYD_TARGET_FILE}"

verify_file_contains_string "${SPOT_USERNAME}" "${SPOTIFYD_CONFIG_TARGET_FILE}"
verify_file_contains_string "${SPOT_PASSWORD}" "${SPOTIFYD_CONFIG_TARGET_FILE}"

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ async def _connect(self):
return await self.client.connect(self.host, self.port)

def connect(self):
# May raise: mpd.base.ConnectionError: Can not send command to disconnected client
"""
Connect to the MPD backend
:raises: mpd.base.ConnectionError
"""
result = asyncio.run_coroutine_threadsafe(self._connect(), self.loop).result()
logger.debug(f"Connected to MPD version {self.client.mpd_version} @ {self.host}:{self.port}")
return result
Expand Down