Skip to content

Commit

Permalink
Do not create albums in --dry-run
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerome Leclanche committed Jan 12, 2014
1 parent e9e31ef commit 63ca37b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions mediacrush
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 63ca37b

Please sign in to comment.