owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.07k stars 236 forks source link

How to configure the playlist directory? #1416

Closed GoSpursGoNL closed 2 years ago

GoSpursGoNL commented 2 years ago

Hi, i'm trying to get saving the queue to a playlist to work. My media directory is under /music and media playback itself using owntone is working fine. My configuration around this is as follows:

# Directories to index
directories = { "/music" }

allow_modifying_stored_playlists = true
default_playlist_directory = "/Playlists"

When starting owntone, this results in the log: Invalid playlist save directory, disabling modifying stored playlists

The same thing happens when I configure: default_playlist_directory = "Playlists"

But if I configure: default_playlist_directory = "/music/Playlists"

Then there is no error logged when starting owntone. Then also the Save button appears in the GUI on the Queue page. But when saving, an error is logged:

web: Invalid playlist save directory '/music/Playlists',
web: JSON api request failed with error code 403 (/api/queue/save?name=test)

So what am I supposed to configure exactly? The folder does exist. Thanks in advance!

Porco-Rosso commented 2 years ago

This looks like it might be a permissions error? Also doublecheck all the paths are indeed correct?

GoSpursGoNL commented 2 years ago

Perhaps indeed. But if we could go one step back please, which one of the three variants of specifying the path is correct? Playlists, /Playlists, /music/Playlists or?

whatdoineed2do commented 2 years ago

which one of the three variants of specifying the path is correct?

full path, /music/Playlist. The error (Invalid playlist save directory '/music/Playlists') you're getting is user running owntone does not have write permissions to the dir

GoSpursGoNL commented 2 years ago

Ah yes indeed, then I see in the logs [2022-02-11 19:16:24] [ WARN] web: Non-writable playlist save directory '/music/Playlists'

Can't figure out yet how to correct this. I'm running Home Assistant OS with Owntone installed via Portainer. So a bit of a special setup perhaps. But it has worked before.

owntone.conf has uid = "root"

The application is started through Portainer with the arguments `environment:

If via linux terminal I do: id myusername (real username replaced with this example) It confirms me these values of 1000. If I then use the same username in owntone.conf, it logs

[2022-02-11 19:54:33] [FATAL]   config: Could not lookup user myusername: No error information,
[2022-02-11 19:54:33] [FATAL]     main: Config file errors; please fix your config,

The weird thing is, if I change the uid in owntone.conf to a random "abc", then this error doesn't occur, and neither with 'root' configured.

GoSpursGoNL commented 2 years ago

Ok, problem solved, I changed the ownership of the music folder to myusername, and then it works. The only mystery then is what to specify as 'uid' in owntone.conf. Because entering 'root' or 'abc' doesn't give any error, but myusername does.

chme commented 2 years ago

It sounds to me like you are running the docker-daapd https://github.com/linuxserver/docker-daapd image. If that is the case, the username in the owntone.conf file has to be the username for the user id 1000 from the container (and not from your linux host). You can try with uid abc in your owntone.conf. At least that is the username I get when running that docker image.

GoSpursGoNL commented 2 years ago

Clear, thanks. Indeed if via Portainer I open a console and enter 'id abc' it returns uid=1000(abc) gid=1000(users) groups=1000(users),1000(users)

So all good now!