### Example: List Artists Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to list artists in the library using the GET /api/library/artists endpoint. ```shell curl -X GET "http://localhost:3689/api/library/artists" ``` -------------------------------- ### Clear queue, add random tracks, and start playback Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Use this example to clear the existing queue, add a specified number of random tracks matching a genre, and immediately start playback. The `clear` and `playback` parameters are crucial for this operation. ```shell curl -X POST "http://localhost:3689/api/queue/items/add?limit=10&clear=true&playback=start&expression=genre+is+%22Pop%22+order+by+random+desc" ``` -------------------------------- ### Get Settings Option Example Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to fetch a specific setting, 'show_composer_now_playing', from the 'webinterface' category using curl. ```shell curl -X GET "http://localhost:3689/api/settings/webinterface/show_composer_now_playing" ``` -------------------------------- ### Build and Install OwnTone Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md After configuring, run make and then make install to build and install OwnTone. ```bash make install ``` -------------------------------- ### Example: List Playlists in Folder Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of listing tracks within a playlist folder using the GET /api/library/playlists/{id}/tracks endpoint. ```shell curl -X GET "http://localhost:3689/api/library/playlists/0/tracks" ``` -------------------------------- ### Example: Get Artist Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to retrieve a specific artist's details using the GET /api/library/artists/{id} endpoint. ```shell curl -X GET "http://localhost:3689/api/library/artists/3815427709949443149" ``` -------------------------------- ### Install Web Interface Files Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md If the player web interface is enabled, this command installs the prebuilt HTML, JS, and CSS files. ```bash sudo make install ``` -------------------------------- ### Download Example MP3 Source: https://github.com/owntone/owntone-server/wiki/Making-an-Analog-In-to-Airplay-RPi-Transmitter This command downloads an example MP3 file to the configured music directory for testing OwnTone. Ensure the directory exists and is accessible. ```bash wget https://file-examples.com/wp-content/uploads/2017/11/file_example_MP3_5MG.mp3 ``` -------------------------------- ### Install on systemd systems Source: https://github.com/owntone/owntone-server/blob/master/src/libairptp/README.md Configure, build, and install the airptpd daemon along with systemd service files. ```bash ./configure --enable-daemon --enable-install-systemd && make sudo make install ``` -------------------------------- ### Build and Install libinotify-kqueue Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Clones the libinotify-kqueue repository, configures, compiles, and installs it. ```bash git clone https://github.com/libinotify-kqueue/libinotify-kqueue cd libinotify-kqueue autoreconf -fvi ./configure make sudo make install cd .. ``` -------------------------------- ### Recommended Build Configuration Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md These are the recommended arguments for the configure script for a system-wide installation. ```bash ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user ``` -------------------------------- ### Configure, Build, and Install OwnTone Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Generates the build system, compiles the source code, and installs the OwnTone server to the system. ```bash autoreconf -i ./configure make sudo make install ``` -------------------------------- ### Install libwebsockets from Source Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Clones the libwebsockets repository and installs it from source, as a development package is not available in Solus. ```bash cd .. git clone https://libwebsockets.org/repo/libwebsockets cd libwebsockets/ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr . make install ``` -------------------------------- ### Install Other Dependencies Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Installs a list of required libraries and tools using Homebrew. ```bash brew install libunistring confuse libplist libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl ffmpeg sqlite ``` -------------------------------- ### Start and Check OwnTone Service Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Starts the OwnTone server using systemd and checks its status. This assumes the systemd service file was installed during the `make install` step. ```bash sudo systemctl start owntone sudo systemctl status owntone ``` -------------------------------- ### Compile and Install Owntone Server Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Configures, compiles, and installs the owntone-server, disabling Spotify support and specifying installation paths. ```bash cd ../owntone-server autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --with-pulseaudio --without-spotify make make install ``` -------------------------------- ### Install Web Interface Dependencies Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Install Node.js dependencies for the player web interface in the web-src folder. ```bash npm install ``` -------------------------------- ### Install Zerotier on Debian-based Server Source: https://github.com/owntone/owntone-server/wiki/Accessing-Owntone-remotely-through-iTunes-Music-with-Zerotier Installs Zerotier using a curl command. Use the first command for a simpler installation or the second for a more robust method involving GPG verification. ```bash curl -s https://install.zerotier.com | sudo bash ``` ```bash curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/master/doc/contact%40zerotier.com.gpg' | gpg --import && \ if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi ``` -------------------------------- ### Install Prerequisites with Homebrew Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Installs gperf, bison, and flex using Homebrew and creates symbolic links for bison and flex in the local bin directory. ```bash brew install gperf bison flex sudo ln -s $(brew --prefix)/opt/bison/bin/bison /usr/local/bin/bison sudo ln -s $(brew --prefix)/opt/flex/bin/flex /usr/local/bin/flex ``` -------------------------------- ### Example Response: Get Artist Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for a single artist, including their ID, name, album count, track count, and total length. ```json { "id": "3815427709949443149", "name": "ABAY", "name_sort": "ABAY", "album_count": 1, "track_count": 10, "length_ms": 2951554, "uri": "library:artist:3815427709949443149" } ``` -------------------------------- ### Example: Get Library Counts (Filtered) Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Demonstrates how to use curl to get library counts filtered by a specific expression, in this case, for items where 'data_kind' is 'file'. ```shell curl -X GET "http://localhost:3689/api/library/count?expression=data_kind+is+file" ``` -------------------------------- ### Device-Specific Configuration Example Source: https://github.com/owntone/owntone-server/blob/master/docs/configuration.md Shows how to apply specific settings to a particular device by defining a device-named section in the configuration. ```conf airplay "Jared's Room" { max_volume = 3 } ``` -------------------------------- ### Example Search Request Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md This example demonstrates how to search for tracks, artists, albums, and playlists containing the term 'the', returning the first two results for each type. ```shell curl -X GET "http://localhost:3689/api/search?type=tracks,artists,albums,playlists&query=the&offset=0&limit=2" ``` -------------------------------- ### Build Web Interface Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Build the web interface and update the htdocs folder after installing dependencies. ```bash npm run build ``` -------------------------------- ### Install OpenJDK 11 and Link Java Executable Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Installs OpenJDK 11 and creates a symbolic link to make the Java executable accessible system-wide. ```bash eopkg install openjdk-11 ln -s /usr/lib/openjdk-11/bin/java /usr/bin/java ``` -------------------------------- ### Example avahi-browse output Source: https://github.com/owntone/owntone-server/blob/master/docs/control-clients/mobile.md This is an example of the output you might see when running `avahi-browse -r -k _touch-remote._tcp`. It shows discovered devices, their IP addresses, and pairing information. ```shell + ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3 _touch-remote._tcp local = ath0 IPv4 59eff13ea2f98dbbef6c162f9df71b784a3ef9a3 _touch-remote._tcp local hostname = [Foobar.local] address = [192.168.1.1] port = [49160] txt = ["DvTy=iPod touch" "RemN=Remote" "txtvers=1" "RemV=10000" "Pair=FAEA410630AEC05E" "DvNm=Foobar"] ``` -------------------------------- ### Example Response: List Playlists in Folder Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response when listing playlists within a folder, showing playlist items, total count, offset, and limit. ```json { "items": [ { "id": 11, "name": "Spotify", "path": "spotify:playlistfolder", "parent_id": "0", "smart_playlist": false, "folder": true, "uri": "library:playlist:11" }, { "id": 8, "name": "bytefm", "path": "/srv/music/Playlists/bytefm.m3u", "parent_id": "0", "smart_playlist": false, "folder": false, "uri": "library:playlist:8" } ], "total": 2, "offset": 0, "limit": -1 } ``` -------------------------------- ### Enable Owntone Service Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Enables the owntone.service to start on boot, but does not start it immediately. ```bash systemctl enable owntone.service ``` -------------------------------- ### Start Owntone Server Service Source: https://github.com/owntone/owntone-server/wiki/Enable-local-playback-with-pipewire-based-distros-(Arch-Endevearous..) Starts the owntone-server system service. ```bash sudo systemctl start owntone.service ``` -------------------------------- ### Install Required Dependencies for Owntone Server Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Installs necessary development tools and libraries required for compiling owntone-server on Solus OS. ```bash cd /home/USER/ mkdir src cd src eopkg install -c system.devel eopkg install gperf gettext-devel libunistring-devel mxml-devel libevent-devel avahi-devel alsa-lib-devel ffmpeg-devel libplist-devel libsodium-devel json-c-devel sqlite3-devel pulseaudio-32bit-devel libconfuse-devel curl-devel protobuf-c-devel git ``` -------------------------------- ### Configure Owntone for Non-Privileged Setup Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Sets environment variables for CFLAGS and LDFLAGS to include Homebrew paths, then configures Owntone with custom installation and data directories, enabling Chromecast and PulseAudio support. ```bash export CFLAGS="-I$(brew --prefix)/include -I$(brew --prefix sqlite)/include" export LDFLAGS="-L$(brew --prefix)/lib -L$(brew --prefix sqlite)/lib" autoreconf -fi ./configure --prefix=$HOME/owntone_data/usr --sysconfdir=$HOME/owntone_data/etc --localstatedir=$HOME/owntone_data/var --enable-chromecast --with-pulseaudio ``` -------------------------------- ### Example ffprobe Metadata with Missing Information Source: https://github.com/owntone/owntone-server/blob/master/docs/advanced/radio-streams.md Another ffprobe metadata example where 'icy-name' is blank and 'StreamUrl' does not point to an image, requiring server configuration tweaks. ```m3u Metadata: icy-br : 127 icy-pub : 0 icy-description : Unspecified description icy-url : icy-genre : various icy-name : StreamTitle : Pour Some Sugar On Me - Def Leppard StreamUrl : https://radio.stream.domain/api9/eventdata/49790578 ``` -------------------------------- ### Compile and Install Owntone Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Compiles and installs Owntone after configuration. This step may require manual installation of Xcode command line tools if automatic installation fails. ```bash make make install ``` -------------------------------- ### Install OwnTone on OpenWrt Source: https://github.com/owntone/owntone-server/blob/master/docs/installation.md Use the opkg package manager to install OwnTone and its dependencies on OpenWrt systems. ```bash opkg install libwebsockets-full owntone ``` -------------------------------- ### Example Response: List Artists Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response when listing artists, showing artist details like ID, name, album count, and track count. ```json { "items": [ { "id": "3815427709949443149", "name": "ABAY", "name_sort": "ABAY", "album_count": 1, "track_count": 10, "length_ms": 2951554, "uri": "library:artist:3815427709949443149" }, ... ], "total": 20, "offset": 0, "limit": -1 } ``` -------------------------------- ### ALSA dmix Configuration Example Source: https://github.com/owntone/owntone-server/blob/master/docs/advanced/outputs-alsa.md Example ALSA configuration snippet for defining a `dmix` device in `/etc/asound.conf` or `~/.asoundrc`. This enables software mixing for devices that cannot handle concurrent streams. ```conf pcm.dmix { type dmix ipc_key dmix-OwnTone slave { pcm "hw:1,0" period_time 0 period_size 1024 buffer_size 4096 rate 48000 } } # OwnTone server configuration using the dmix device audio { nickname = "Computer" type = "alsa" card = "dmix" } ``` -------------------------------- ### Example: Update Playlist Tracks Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to use the PUT /api/library/playlists/{id}/tracks endpoint to update track play counts. ```shell curl -X PUT "http://localhost:3689/api/library/playlists/1/tracks?play_count=played" ``` -------------------------------- ### Run OwnTone Server for Development Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Start the OwnTone server in the foreground for development purposes. ```bash ./src/owntone -f ``` -------------------------------- ### Change Settings Option Example Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to change the 'show_composer_now_playing' setting to true using curl and providing the new value in the request body. ```shell curl -X PUT "http://localhost:3689/api/settings/webinterface/show_composer_now_playing" --data "{\"name\":\"show_composer_now_playing\",\"value\":true}" ``` -------------------------------- ### Example: List Albums by Genre ('90s Alternative) Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Demonstrates how to query for a genre with apostrophes and numbers, requiring appropriate URL encoding. ```shell curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"%2790s%20Alternative\"" ``` -------------------------------- ### Install OwnTone on FreeBSD Source: https://github.com/owntone/owntone-server/blob/master/docs/installation.md Use the pkg package manager to install OwnTone on FreeBSD systems. Refer to the FreeBSD ports for more details. ```bash pkg install owntone ``` -------------------------------- ### Example ffprobe Metadata Output Source: https://github.com/owntone/owntone-server/blob/master/docs/advanced/radio-streams.md An example of metadata extracted from a radio stream using ffprobe, showing various 'icy-' tags and 'StreamTitle'. ```m3u Metadata: icy-br : 320 icy-description : DJ-mixed blend of modern and classic rock, electronica, world music, and more. Always 100% commercial-free icy-genre : Eclectic icy-name : Radio Paradise (320k aac) icy-pub : 1 icy-url : https://radioparadise.com StreamTitle : Depeche Mode - Strangelove StreamUrl : http://img.radioparadise.com/covers/l/B000002LCI.jpg ``` -------------------------------- ### Example: Unplayed Podcasts and Audiobooks Source: https://github.com/owntone/owntone-server/blob/master/docs/smart-playlists.md Finds podcast and audiobook files that have not yet been played. ```smartpl "Unplayed podcasts and audiobooks" { play_count = 0 and (media_kind is podcast or media_kind is audiobook) } ``` -------------------------------- ### Install Build Dependencies on Debian/Ubuntu Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Installs essential build tools and libraries required for compiling OwnTone on Debian-based systems. Ensure you have the necessary repositories enabled. ```bash sudo apt-get install \ build-essential git autotools-dev autoconf automake libtool gettext gawk \ gperf bison flex libconfuse-dev libunistring-dev libsqlite3-dev \ libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev \ libasound2-dev libxml2-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev \ libevent-dev libplist-dev libsodium-dev libjson-c-dev libwebsockets-dev \ libcurl4-openssl-dev libprotobuf-c-dev ``` -------------------------------- ### Example: Local Music Files Source: https://github.com/owntone/owntone-server/blob/master/docs/smart-playlists.md Matches music files added directly to the library, excluding those categorized as podcasts or audiobooks. ```smartpl "Local music" { data_kind is file and media_kind is music } ``` -------------------------------- ### Example: Recently Added Music Source: https://github.com/owntone/owntone-server/blob/master/docs/smart-playlists.md Retrieves the 10 most recently added music files to the library. ```smartpl "Recently added music" { media_kind is music order by time_added desc limit 10 } ``` -------------------------------- ### Run OwnTone Server Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Starts the OwnTone server as a system service. Ensure configuration is adjusted prior to running. ```bash sudo /usr/local/sbin/owntone ``` -------------------------------- ### Install Build Dependencies on Fedora Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Installs essential build tools and libraries for compiling OwnTone on Fedora systems. Ensure the free RPM Fusion packages are enabled for ffmpeg. ```bash sudo dnf install \ git automake autoconf gettext-devel gperf gawk libtool bison flex \ sqlite-devel libconfuse-devel libunistring-devel libxml2-devel libevent-devel \ avahi-devel libgcrypt-devel zlib-devel alsa-lib-devel ffmpeg-devel \ libplist-devel libsodium-devel json-c-devel libwebsockets-devel \ libcurl-devel protobuf-c-devel ``` -------------------------------- ### Display Configure Options Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Use this command to see all available configuration options. ```bash ./configure --help ``` -------------------------------- ### Get a list of available outputs Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieve a list of all available audio outputs configured in the system. ```APIDOC ## GET /api/outputs ### Description Get a list of available outputs. ### Method GET ### Endpoint /api/outputs ### Response #### Success Response Details about the response body are not provided in the source text. ### Request Example ```shell # Example request not provided in source text. ``` ``` -------------------------------- ### Example: List Albums by Genre (Drum & Bass) Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Illustrates querying for a genre containing an ampersand, requiring URL encoding for the ampersand. ```shell curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Drum%20%26%20Bass\"" ``` -------------------------------- ### Prepare Development Directories Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Create directories for runtime data when setting up a development environment for a non-privileged user. ```bash mkdir -p $HOME/owntone_data/etc mkdir -p $HOME/owntone_data/media ``` -------------------------------- ### List all playlists response Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for listing playlists, showing playlist items, total count, and pagination details. ```json { "items": [ { "id": 1, "name": "radio", "path": "/music/srv/radio.m3u", "smart_playlist": false, "uri": "library:playlist:1" }, ... ], "total": 20, "offset": 0, "limit": -1 } ``` -------------------------------- ### Relative Date and Media Type Example Source: https://github.com/owntone/owntone-server/blob/master/docs/smart-playlists.md Combine relative date filtering with media type criteria. This example matches audiobooks played since the start of last week. ```text "Recently played audiobooks" { time_played after last week and media_kind is audiobook } ``` -------------------------------- ### List Settings Categories Response Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for the /api/settings endpoint, detailing available categories and their options. ```json { "categories": [ { "name": "webinterface", "options": [ { "name": "show_composer_now_playing", "type": 1, "value": true }, { "name": "show_composer_for_genre", "type": 2, "value": "classical" } ] } ] } ``` -------------------------------- ### Server Configuration Response Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for the /api/config endpoint, showing server version, websocket port, and build options. ```json { "websocket_port": 3688, "version": "25.0", "buildoptions": [ "ffmpeg", "iTunes XML", "Spotify", "LastFM", "MPD", "Device verification", "Websockets", "ALSA" ] } ``` -------------------------------- ### Get a specific playlist response Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for retrieving a single playlist, containing its details. ```json { "id": 1, "name": "radio", "path": "/music/srv/radio.m3u", "smart_playlist": false, "uri": "library:playlist:1" } ``` -------------------------------- ### Generate Build System Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Run this command first to generate the configure script and Makefile.in. ```bash autoreconf -i ``` -------------------------------- ### Get Settings Category Response Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example JSON response for fetching a specific settings category, showing its name and a list of its options with their current values. ```json { "name": "webinterface", "options": [ { "name": "show_composer_now_playing", "type": 1, "value": true }, { "name": "show_composer_for_genre", "type": 2, "value": "classical" } ] } ``` -------------------------------- ### Prepare Configuration for Test Run Source: https://github.com/owntone/owntone-server/wiki/Installing-on-MacOS-(14.7) Creates a media directory and modifies the Owntone configuration file to set the user ID, log level to debug, and the media directory path. ```bash mkdir -p $HOME/owntone_data/media sed -i '' 's/uid = "owntone"/uid = ${USER}/g' $HOME/owntone_data/etc/owntone.conf sed -i '' 's/loglevel = log/loglevel = debug/g' $HOME/owntone_data/etc/owntone.conf sed -i '' 's/directories = { "\/srv\/music" }/directories = { "${HOME}\/owntone_data\/media" }/g' $HOME/owntone_data/etc/owntone.conf ``` -------------------------------- ### Delete Settings Option Example Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Example of how to delete the 'show_composer_now_playing' setting using curl. ```shell curl -X DELETE "http://localhost:3689/api/settings/webinterface/show_composer_now_playing" ``` -------------------------------- ### Serve Web Interface Locally Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Run this command to serve the web interface locally for development. It proxies API calls to the OwnTone server. ```bash npm run serve ``` -------------------------------- ### Install MacPorts Dependencies Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Installs essential development tools and libraries required for building OwnTone on macOS using MacPorts. ```bash sudo port install \ autoconf automake libtool pkgconfig git gperf bison flex libgcrypt \ libunistring libconfuse ffmpeg libevent json-c libwebsockets curl \ libplist libsodium protobuf-c libxml2 ``` -------------------------------- ### Example: List Albums by Genre (Rock/Pop) Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Shows how to query for albums in a genre with a slash, like 'Rock/Pop', using URL encoding for the slash character. ```shell curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Rock%2FPop\"" ``` -------------------------------- ### Clone Owntone Server Repository and Install ANTLR Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Clones the owntone-server source code from GitHub and installs the ANTLR3.5 parser generator. ```bash git clone https://github.com/owntone/owntone-server.git cd owntone-server/ #now lets install antlr scripts/antlr35_install.sh ``` -------------------------------- ### Create OwnTone Directories and Set Permissions Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Ensures necessary directories for runtime operation exist and sets appropriate ownership for cache files. ```bash sudo mkdir -p /usr/local/var/run sudo mkdir -p /usr/local/var/log # or change logfile in conf sudo chown unknown /usr/local/var/cache/owntone # or change conf ``` -------------------------------- ### Build libairptp and airptpd Source: https://github.com/owntone/owntone-server/blob/master/src/libairptp/README.md Build both the libairptp library and the airptpd daemon using autotools. ```bash autoreconf -vi && ./configure --enable-daemon && make ``` -------------------------------- ### Configure HiFiBerry DAC+ADC Pro Overlay Source: https://github.com/owntone/owntone-server/wiki/Making-an-Analog-In-to-Airplay-RPi-Transmitter Add this line to `/boot/config.txt` to configure the HiFiBerry DAC+ADC Pro, disabling LEDs and setting it to slave mode. Remember to remove `dtparam=audio=on` and run `sudo rpi-update`. ```config dtoverlay=hifiberry-dacplusadcpro,slave,leds_off=true ``` -------------------------------- ### Build with tests enabled Source: https://github.com/owntone/owntone-server/blob/master/src/libairptp/README.md Configure and build the project with testing enabled to verify functionality. ```bash ./configure --enable-daemon --enable-tests && make && make check ``` -------------------------------- ### Create Owntone User and Set Permissions Source: https://github.com/owntone/owntone-server/wiki/Installing-Owtone-Server-from-Github-in-Solus-OS-4.3 Creates a dedicated 'owntone' user and group, sets its home directory, and assigns ownership of the cache directory. ```bash useradd owntone -d /var/cache/owntone -g audio chown -R owntone /var/cache/owntone ``` -------------------------------- ### Example: List Albums by Genre (Pop) Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Demonstrates how to list albums for the 'Pop' genre using curl. Special characters in genre names may require URL encoding. ```shell curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Pop\"" ``` -------------------------------- ### Build OwnTone Web Interface Source: https://github.com/owntone/owntone-server/blob/master/docs/development.md Commands to build the OwnTone web interface. Navigate to the web-src directory before running. ```bash cd web-src npm run build ``` -------------------------------- ### List All Settings Categories Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Fetch a list of all available settings categories and their options. This provides an overview of configurable aspects of the server. ```shell curl -X GET "http://localhost:3689/api/settings" ``` -------------------------------- ### Systemd Service Unit for forked-daapd Cache Source: https://github.com/owntone/owntone-server/wiki/Running-db-in-RAM-with-systemd-service This service unit defines the forked-daapd overlay cache service. It ensures the cache is started before the main forked-daapd service and handles starting and stopping the cache script. ```systemd [Unit] Description=forked daapd overlay cache service Before=forked-daapd.service [Service] Type=oneshot EnvironmentFile=-/etc/sysconfig/forked-daapd ExecStart=/usr/sbin/forked-daapd-cache.sh start $CACHE_OVERLAY_SZ ExecStop=/usr/sbin/forked-daapd-cache.sh stop RemainAfterExit=true [Install] RequiredBy=forked-daapd.service ``` -------------------------------- ### Clone and Build OwnTone Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Clones the OwnTone repository, configures the build with common options, compiles the source code, and installs the application. The `--enable-install-user` flag adds a system user and group for OwnTone. ```bash git clone https://github.com/owntone/owntone-server.git cd owntone-server autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user make sudo make install ``` -------------------------------- ### Get an album Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieves a specific album from the library by its ID. ```APIDOC ## GET /api/library/albums/{id} ### Description Get a specific album in your library. ### Method GET ### Endpoint /api/library/albums/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Album id ### Response #### Success Response (200) - **album** (object) - The [`album`](#album-object) object ### Request Example ```shell curl -X GET "http://localhost:3689/api/library/albums/8009851123233197743" ``` ### Response Example ```json { "id": "8009851123233197743", "name": "Add Violence", "name_sort": "Add Violence", "artist": "Nine Inch Nails", "artist_id": "32561671101664759", "track_count": 5, "length_ms": 1634961, "uri": "library:album:8009851123233197743" } ``` ``` -------------------------------- ### Get a playlist Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieves a specific playlist from your library by its ID. ```APIDOC ## GET /api/library/playlists/{id} ### Description Get a specific playlist in your library. ### Method GET ### Endpoint /api/library/playlists/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - Playlist id ### Response #### Success Response (200) - **playlist** (object) - The [`playlist`](#playlist-object) object ### Response Example ```json { "id": 1, "name": "radio", "path": "/music/srv/radio.m3u", "smart_playlist": false, "uri": "library:playlist:1" } ``` ``` -------------------------------- ### Run airptpd in background Source: https://github.com/owntone/owntone-server/blob/master/src/libairptp/README.md Start the airptpd daemon in the background after building. ```bash sudo ./daemon/airptpd ``` -------------------------------- ### Get a category Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieve all available options for a specific settings category. ```APIDOC ## GET /api/settings/{category-name} ### Description Get a settings category with its options. ### Method GET ### Endpoint /api/settings/{category-name} ### Parameters #### Path Parameters - **category-name** (string) - Required - The name of the settings category ### Response #### Success Response (200) Returns a settings category object ### Response Example ```json { "name": "webinterface", "options": [ { "name": "show_composer_now_playing", "type": 1, "value": true }, { "name": "show_composer_for_genre", "type": 2, "value": "classical" } ] } ``` ``` -------------------------------- ### Request library backup Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Initiate a library backup. This requires configuration to be enabled and a valid writable path to be set. Returns 200 OK on success, 503 if backups are not enabled, or 500 for other errors. ```http PUT /api/library/backup ``` ```shell curl -X PUT "http://localhost:3689/api/library/backup" ``` -------------------------------- ### Configure and Build OwnTone on Fedora Source: https://github.com/owntone/owntone-server/blob/master/docs/building.md Configures the build with common options, compiles the source code, and installs the application on Fedora. The `--enable-install-user` flag adds a system user and group for OwnTone. ```bash autoreconf -i ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-install-user make sudo make install ``` -------------------------------- ### Get an option Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieve the value of a single setting option within a category. ```APIDOC ## GET /api/settings/{category-name}/{option-name} ### Description Get a single setting option. ### Method GET ### Endpoint /api/settings/{category-name}/{option-name} ### Parameters #### Path Parameters - **category-name** (string) - Required - The name of the settings category - **option-name** (string) - Required - The name of the setting option ### Response #### Success Response (200) Returns the value of the specified setting option. ``` -------------------------------- ### Get an output Source: https://github.com/owntone/owntone-server/blob/master/docs/json-api.md Retrieve detailed information about a specific audio output by its ID. ```APIDOC ## GET /api/outputs/{id} ### Description Get an output. ### Method GET ### Endpoint /api/outputs/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the output to retrieve. ### Response #### Success Response Details about the response body are not provided in the source text. ### Request Example ```shell # Example request not provided in source text. ``` ```