Skip to content

Commit

Permalink
added support for teddycloud upload during batch processing
Browse files Browse the repository at this point in the history
  • Loading branch information
marco79cgn committed Dec 17, 2024
1 parent 3370fad commit e4a8f14
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions audio2tonie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ else
echo "${OUTPUT_FILE}..."
python3 $OPUS_2_TONIE_PATH/opus2tonie.py "$d" "$SOURCE/$OUTPUT_FILE"
echo "Created $OUTPUT_FILE with $count chapter(s)."
if [ "$TEDDYCLOUD_IP" ]; then
echo -n "Uploading file to Teddycloud..."
response_code=$(curl -s -o /dev/null -F "file=@$OUTPUT_FILE" -w "%{http_code}" "http://$TEDDYCLOUD_IP/api/fileUpload?path=&special=library")
if [ "${response_code}" != 200 ]; then
echo "Error trying to upload to Teddycloud."
else
echo ": OK"
fi
fi
echo $SEPARATOR
done
echo "Finished! Enjoy."
Expand Down

0 comments on commit e4a8f14

Please sign in to comment.