From 63ca37bc9b49f6f0e964e146e07af1b1c56173ae Mon Sep 17 00:00:00 2001 From: Jerome Leclanche Date: Sun, 12 Jan 2014 05:28:59 +0000 Subject: [PATCH] Do not create albums in --dry-run --- mediacrush | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mediacrush b/mediacrush index 56d68b1..ec4cb54 100755 --- a/mediacrush +++ b/mediacrush @@ -139,13 +139,17 @@ upload() { done if [[ $create_album == true ]]; then - echo -n "Creating album..." - out=$(curl --silent -F "list=$uploads" "$server/api/album/create") - hash=$(echo $out | sed -nre 's#.*"hash": "([^"]+)".*#\1#p') - echo -e "\r\033[KAlbum: $server/$hash" - - if [[ $open_files == true ]]; then - xdg-open "$server/$hash" + if [[ $dry_run == true ]]; then + echo "Album: (not available)" + else + echo -n "Creating album..." + out=$(curl --silent -F "list=$uploads" "$server/api/album/create") + hash=$(echo $out | sed -nre 's#.*"hash": "([^"]+)".*#\1#p') + echo -e "\r\033[KAlbum: $server/$hash" + + if [[ $open_files == true ]]; then + xdg-open "$server/$hash" + fi fi elif [[ $open_files == true ]]; then for upload in "$uploads"; do