expand empty connection string to localhost

This commit is contained in:
Denis Lehmann 2021-06-12 17:26:04 +02:00
parent 3532edc252
commit 55e2f39fdd
2 changed files with 11 additions and 4 deletions

9
strm
View file

@ -232,8 +232,13 @@ for media_directory in "${media_directories[@]}"; do
# Get connection string and remote directory
IFS="/" read -r connection_string directory <<< "$media_directory"
# Check validity of variables
if [ "$connection_string" == "" ] || [ "$directory" == "" ]; then
# Correct empty connection string
if [ "$connection_string" == "" ]; then
connection_string="localhost"
fi
# Check validity of directory
if [ "$directory" == "" ]; then
error "Not a valid media directory: $media_directory"
fi

View file

@ -5,9 +5,10 @@
# Multiple media directories can be set with a comma (,) as delimiter.
# Spaces must be escaped with a backslash (\).
# Media directories are queried and played in order.
# If <SSH connection string> is not set, 'localhost' is used.
#
# Examples:
# localhost/home/bob/videos
# /home/bob/videos
# remote-machine/home/bob/music
# bob@another-machine/media/movies,bob@10.0.0.1/home/bob/series
media_directories=""
@ -17,9 +18,10 @@ media_directories=""
# <SSH connection string><absolute_path_to_media_directory>
#
# If it is not set, the mpv resume playback functionality is not enabled by default.
# If <SSH connection string> is not set, 'localhost' is used.
#
# Examples:
# localhost/home/bob/.strm
# /home/bob/.strm
# remote-machine/home/bob/strm
# bob@another-machine/home/bob/strm
playback_directory=""