enhance logging
This commit is contained in:
parent
cf3dbdf747
commit
af775540d4
1 changed files with 11 additions and 3 deletions
14
strm
14
strm
|
|
@ -114,6 +114,8 @@ for media_directory in "${media_directories[@]}"; do
|
||||||
# Get connection string and remote directory
|
# Get connection string and remote directory
|
||||||
IFS="/" read -r connection_string directory <<< "$media_directory"
|
IFS="/" read -r connection_string directory <<< "$media_directory"
|
||||||
|
|
||||||
|
echo "Fetching results from $connection_string"
|
||||||
|
|
||||||
# Add leading and trailing slash to directory if missing
|
# Add leading and trailing slash to directory if missing
|
||||||
[[ "$directory" != /*/ ]] && directory="/$directory/"
|
[[ "$directory" != /*/ ]] && directory="/$directory/"
|
||||||
|
|
||||||
|
|
@ -132,21 +134,27 @@ for media_directory in "${media_directories[@]}"; do
|
||||||
print_results=("${print_results[@]}" "${tmp_print_results[@]}")
|
print_results=("${print_results[@]}" "${tmp_print_results[@]}")
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
# Exit if no results found
|
# Exit if no results found
|
||||||
if [ "${#sftp_results[@]}" == 0 ]; then
|
if [ "${#sftp_results[@]}" == 0 ]; then
|
||||||
echo "No files found with given query"
|
echo "No files found with given query"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# List files
|
# Print result header
|
||||||
if [ "$list" == false ]; then
|
if [ "$list" == false ]; then
|
||||||
if [ "$shuffle" == true ]; then
|
if [ "$shuffle" == true ]; then
|
||||||
echo -e "Playing the following files in random order:\n"
|
echo "Playing the following files in random order:"
|
||||||
else
|
else
|
||||||
echo -e "Playing the following files:\n"
|
echo "Playing the following files:"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "Found the following files:"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
|
||||||
# Print results
|
# Print results
|
||||||
for result in "${print_results[@]}"; do
|
for result in "${print_results[@]}"; do
|
||||||
echo "$result"
|
echo "$result"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue