musicdb/README.md

95 lines
3.2 KiB
Markdown
Raw Normal View History

2023-08-13 23:58:53 +02:00
# musicdb
A feature-rich music player consisting of a server and a client.
2023-08-13 23:58:53 +02:00
## Library
2023-08-13 23:58:53 +02:00
- search for artists, albums, songs
- apply filters to your search
- select multiple songs, albums, artists
- drag songs, albums, artists or your selection to add them to the queue
2023-09-28 16:39:32 +02:00
## Queue
2023-08-13 23:58:53 +02:00
- recursive structure, organized by how songs were added
+ adding an album puts the songs in a folder
+ if you add an album, you can drag the entire folder rather than individual songs
+ adding an artist adds a folder containing a folder for each album
- shuffle
+ works like a folder, but plays its contents in a random order
+ reshuffles as you add new songs
+ only shuffles elements that you didn't listen to yet, so you won't hear a song twice
+ can shuffle any element, so you could, for example, listen to random albums, but the songs in each album stay in the correct order
- repeat
+ can repeat its contents forever or n times
2023-08-13 23:58:53 +02:00
2024-01-10 16:41:23 +01:00
https://github.com/Dummi26/musicdb/assets/67615357/888a2217-6966-490f-a49f-5085ddcf3461
## Server
2023-08-13 23:58:53 +02:00
The server caches the next song before it is played,
so you get gapless playback even when loading songs from a very slow disk or network-attached storage (NAS).
2023-08-13 23:58:53 +02:00
It can be accessed using the client (TCP), or a website it can optionally host.
It should also be very easy to switch from TCP to any other protocol, since most of the code in this project just requires the `Read + Write` traits, not specifically a TCP connection.
2023-08-13 23:58:53 +02:00
## Clients
2023-08-13 23:58:53 +02:00
Multiple clients can connect to a server at the same time.
All connected clients will be synchronized, so if you do something on one device, all other connected devices will show that change.
2023-08-13 23:58:53 +02:00
The client can show a user interface (`gui`) or even connect to the server and mirror its playback (`syncplayer-*`).
2023-08-13 23:58:53 +02:00
Using the `syncplayer` functionality, you can play the same music on multiple devices, in multiple different locations.
2023-08-13 23:58:53 +02:00
2024-01-10 16:41:23 +01:00
https://github.com/Dummi26/musicdb/assets/67615357/afb0c9fa-3cf0-414a-a59f-7e462837b989
# Setup
2023-08-13 23:58:53 +02:00
Review, then run the `setup.sh` script:
2023-08-14 00:20:09 +02:00
```sh
./setup.sh ~/my_dbdir ~/music
```
2023-08-14 00:20:09 +02:00
Where `~/music` is the directory containing your music (mp3 files).
2023-08-14 00:20:09 +02:00
Confirm that all paths are correct, then press Enter when prompted.
2023-08-14 00:20:09 +02:00
You will probably have to add a valid font path to the client's gui config, for example
2023-08-14 00:20:09 +02:00
```toml
font = '/usr/share/fonts/...'
2023-08-14 00:20:09 +02:00
...
2023-08-14 00:20:09 +02:00
```
The script will start a server and client.
After closing the client, the server may still be running, so you may have to `pkill musicdb-server` if you want to stop it.
2023-08-14 00:20:09 +02:00
To open the player again:
2023-08-14 00:20:09 +02:00
```sh
musicdb-client 0.0.0.0:26002 gui
2023-08-14 00:20:09 +02:00
```
To start the server:
2023-08-14 00:20:09 +02:00
```sh
musicdb-server --tcp 0.0.0.0:26002 --play-audio local ~/my_dbdir ~/music
2023-08-14 00:20:09 +02:00
```
A simple script can start the server and then the client:
```sh
# if the server is already running, this command will fail since 0.0.0.0:26002 is already in use,
# and you will never end up with 2+ servers running at the same time
musicdb-server --tcp 0.0.0.0:26002 --play-audio local ~/my_dbdir ~/music &
# wait for the server to load (on most systems, this should never take more than 0.1 seconds, but just in case...)
sleep 1
# now start the client
musicdb-client 0.0.0.0:26002 gui
2023-08-14 00:20:09 +02:00
```
2023-10-24 20:07:17 +02:00
You could use this script from a `.desktop` file to get a menu entry which simply opens the player.