prokosna / sola_mpd

MIT License
12 stars 0 forks source link

Sola MPD

Sola MPD is a web-based MPD client focused on usability with flexible browsing and advanced search.

This client has the following features:

On the other hand, the following features are out of scope for now:

Feel free to file an issue if you are interested in some of missing capabilities.

Sola MPD only supports MPD version 0.21 or later.

Screenshot gifs

Intuitive control

sola_mpd_usage_queue

Flexible browsing

sola_mpd_usage_browser

Advanced search

sola_mpd_usage_search

Dark theme

sola_mpd_usage_dark

Responsive layout for tablets

sola_mpd_responsive

How to install

Sola MPD is a web based client and needs to be deployed on your server in the local network.

It can be the same server as the MPD server or on a different server, as long as it can communicate with the MPD server.

Sola MPD only requires Docker installed on the server.

  1. Ensure a docker process is running on the server
$ docker ps

If you have any issues, please confirm if you installed Docker correctly.

  1. Clone this repository on your server
$ git clone git@github.com:prokosna/sola_mpd
  1. Move to the folder
$ cd sola_mpd
  1. Build a docker image (It takes several minutes. Please have a :coffee:)
$ docker/build.sh
  1. And run (The default port is 3000, but you can change it by --port argument.)
$ docker/start.sh [--port 3000]
  1. Access to http://[Your Server IP]:3000 from your browser

  2. In the setup dialog, please enter the endpoint of your mpd server which can be accessed from the Sola MPD server. If your mpd server is running on the same server, you need to use "host.docker.internal" instead of "localhost".

How to update

The main branch should be always the latest working branch.

You just need to stop the running container, pull the latest main branch and run the latest container.

$ cd sola_mpd
$ git pull origin main
$ docker/remove.sh
$ docker/build.sh
$ docker/start.sh

Usage tips (operations & shortcut keys)

Action Description
Double click Add the song to the end of the play queue and play that song
Shift + select a song Range selection
Ctrl + select a song Multiple selection
Ctrl + A Select all visible songs
Space Pause or resume playback
Add (Context menu) Add the selected songs to the play queue
Replace (Context menu) Replace the current play queue with the selected songs
Edit Columns (Context menu) Edit the metadata to be used as columns - The order can be changed by directly dragging & dropping the column on the table.

Plugin

Sola MPD has a plugin system to integrate with other services.

For example, I have a use case to synchronize MPD songs with a Astiga playlist and have developed the Astiga plugin.

To use the Astiga plugin:

  1. Move to the plugin folder
$ cd sola_mpd/plugins/astiga
  1. Run the plugin
$ docker/build.sh
$ docker/start.sh [--port 3001] [--host]

Note: If you have any network errors, please try --host which uses Docker host network mode.

  1. On the Plugin page in Sola MPD, enter the plugin endpoint (in this case [Your Server IP]:3001) and configure the plugin following a dialog.
  2. When the plugin is available, the right-click context menu has Sync with Astiga and you can create a playlist with selected songs on Sola MPD as long as the exact same songs are available on Astiga as well.

This plugin is quite specific to my use case, but you can use this as a reference to develop a custom plugin for your use case.

For developers

Sola MPD is written in TypeScript with React, Vite, Protocol Buffers and so on.

# 1. Install dependencies, set up a husky hook for format/lint
$ npm i

# 2. Compile protobuf messages as all objects are defined in the Protobuf format
$ npm run proto

# 3. Build the domain package
$ npm run -w packages/domain build

# 4. Run dev servers
$ npm run -w packages/backend dev
$ npm run -w packages/frontend dev