handle no results

This commit is contained in:
Denis Lehmann 2021-04-25 14:57:41 +02:00
parent 2603d89271
commit 349393896d

8
strm
View file

@ -16,7 +16,7 @@ function print_usage {
echo " strm -l . # List all available files"
echo " strm Elephants Dream # Play files whose path contain 'elephants' and 'dream' in order"
echo " strm e*phants # Play files whose path matches the wildcard 'e*phants'"
exit 0
exit
}
function error {
@ -132,6 +132,12 @@ for media_directory in "${media_directories[@]}"; do
print_results=("${print_results[@]}" "${tmp_print_results[@]}")
done
# Exit if no results found
if [ "${#sftp_results[@]}" == 0 ]; then
echo "No files found with given query"
exit
fi
# List files
if [ "$list" == false ]; then
if [ "$shuffle" == true ]; then