]> git.rmz.io Git - dotfiles.git/blobdiff - bin/addnzb
lazyvim: absorb keymaps
[dotfiles.git] / bin / addnzb
index ec6f0143591a633e599b116cbe9ac18f966e1ee4..511c1bf2422319a048caccb6eee156debb96fb21 100755 (executable)
@@ -33,12 +33,19 @@ while [[ $# -gt 0 ]]; do
     esac
 done
 
+# set priority to high
+extra_data=(-F priority=1)
 if [[ -n $category ]]; then
-    extra_data="-F cat=$category"
+    extra_data+=(-F cat=$category)
 fi
 
 for f in ${args[@]}; do
-    curl -s -F apikey="$API_KEY" -F mode="addfile" -F name=@"$f" $extra_data $URL/sabnzbd/api &> /dev/null
+    curl --silent --show-error \
+        $URL/sabnzbd/api \
+        -F apikey="$API_KEY" \
+        -F mode="addfile" \
+        -F name="@$f" \
+        "${extra_data[@]}"
     if [[ $? -eq 0 ]]; then
         echo "Uploaded '$f'"
         rm $f