From 5add9c477ef5422e04c742d9eb6d8de3e0e30f47 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 14 Aug 2023 00:20:09 +0200 Subject: [PATCH] readme++ --- .gitignore | 0 README.md | 93 +++++++++++++++++++ musicdb-client/src/gui_settings.rs | 0 musicdb-server/assets/album-view.html | 0 musicdb-server/assets/albums_one.html | 0 musicdb-server/assets/artist-view.html | 0 musicdb-server/assets/artists.html | 0 musicdb-server/assets/artists_one.html | 0 musicdb-server/assets/queue.html | 0 musicdb-server/assets/queue_folder.html | 0 .../assets/queue_folder_current.html | 0 musicdb-server/assets/queue_song.html | 0 musicdb-server/assets/queue_song_current.html | 0 musicdb-server/assets/root.html | 0 musicdb-server/assets/songs_one.html | 0 musicdb-server/src/web.rs | 0 16 files changed, 93 insertions(+) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 README.md mode change 100644 => 100755 musicdb-client/src/gui_settings.rs mode change 100644 => 100755 musicdb-server/assets/album-view.html mode change 100644 => 100755 musicdb-server/assets/albums_one.html mode change 100644 => 100755 musicdb-server/assets/artist-view.html mode change 100644 => 100755 musicdb-server/assets/artists.html mode change 100644 => 100755 musicdb-server/assets/artists_one.html mode change 100644 => 100755 musicdb-server/assets/queue.html mode change 100644 => 100755 musicdb-server/assets/queue_folder.html mode change 100644 => 100755 musicdb-server/assets/queue_folder_current.html mode change 100644 => 100755 musicdb-server/assets/queue_song.html mode change 100644 => 100755 musicdb-server/assets/queue_song_current.html mode change 100644 => 100755 musicdb-server/assets/root.html mode change 100644 => 100755 musicdb-server/assets/songs_one.html mode change 100644 => 100755 musicdb-server/src/web.rs diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 746d4aa..5b826a0 --- a/README.md +++ b/README.md @@ -29,3 +29,96 @@ for (almost) gapless playback, even when the data is stored on a NAS or cloud when storing data on a cloud, it would take forever to load all songs and scan them for metadata. you would also run into issues with different file formats and where to store the cover images. a custom database speeds up server startup and allows for more features. + +## usage + +### build + +build `musicdb-server` and `musicdb-client` using cargo. +for the client, you may need to change the path used in `include_bytes!(...)` to one that actually points to a valid font on your system. + +## setup + +### server/client + +#### prep + +You need some directory where your music is located (mp3 files). +I will assume this is `/music` for simplicity. + +The structure should be `/music/Artist/Album/Song.mp3` so we can automatically +populate the database with your songs. if it isn't, songs will need to be added manually (for now). + +You will also need a file that will hold your database. +I will assume this is `dbfile`. + +Note: Instead of adding the executables (`musicdb-client` and `musicdb-server`) to your `$PATH`, you can run `cargo run --release -- ` followed by the arguments. +Since this is using cargo, you need to be in the source directorie for whatever you want to run. + +#### initializing the server + +run the server without arguments to see the current syntax. + +To initialize a new database: + +```sh +musicdb-server dbfile --init /music --tcp 127.0.0.1:12345 --web 127.0.0.1:8080 +``` + +#### adding songs + +While the server is running, the client can add songs to it: + +##### automatically + +If your files are stored as `/music/Artist/Album/Song.mp3`, +the client can go through these files and add them all to the database. +For this to work, the client should be running on the same machine as the server +(the contents of `/music` must match). + +```sh +musicdb-client filldb 127.0.0.1:12345 +``` + +You can open `127.0.0.1:8080` in a browser to see the songs being added in real-time. + +##### manually + +You can use the client's cli mode to manually add songs (this is annoying. don't.) + +```sh +musicdb-client cli 127.0.0.1:12345 +``` + +##### saving + +```sh +musicdb-client cli 127.0.0.1:12345 +``` + +Now, start the client's cli mode and type 'save'. The server will now create (or overwrite) `dbfile`. + +And that's it - you can now use the player. For a user-friendly(er) interface, start the client in gui mode: + +```sh +musicdb-client gui 127.0.0.1:12345 +``` + +#### (re)starting the server + +To load an existing dbfile, remove the `init` part from the command used earlier: + +```sh +musicdb-server dbfile --tcp 127.0.0.1:12345 --web 127.0.0.1:8080 +``` + +And that's it - the rest should just work. + +### syncplayer + +If `/music` is the same on two devices, one can act as the server and the other as a client +that simply mirrors the server using the client's syncplayer mode: + +```sh +musicdb-client syncplayer 127.0.0.1:12345 +``` diff --git a/musicdb-client/src/gui_settings.rs b/musicdb-client/src/gui_settings.rs old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/album-view.html b/musicdb-server/assets/album-view.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/albums_one.html b/musicdb-server/assets/albums_one.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/artist-view.html b/musicdb-server/assets/artist-view.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/artists.html b/musicdb-server/assets/artists.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/artists_one.html b/musicdb-server/assets/artists_one.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/queue.html b/musicdb-server/assets/queue.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/queue_folder.html b/musicdb-server/assets/queue_folder.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/queue_folder_current.html b/musicdb-server/assets/queue_folder_current.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/queue_song.html b/musicdb-server/assets/queue_song.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/queue_song_current.html b/musicdb-server/assets/queue_song_current.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/root.html b/musicdb-server/assets/root.html old mode 100644 new mode 100755 diff --git a/musicdb-server/assets/songs_one.html b/musicdb-server/assets/songs_one.html old mode 100644 new mode 100755 diff --git a/musicdb-server/src/web.rs b/musicdb-server/src/web.rs old mode 100644 new mode 100755