Skip to content

Commit

Permalink
Update qbittorrent-prune.sh
Browse files Browse the repository at this point in the history
This fixes an issue where torrent hashes would not be processed correctly into an array.
This results in torrents not being identified as unregistered.
This also fixes onedr0p#4.
  • Loading branch information
heathlarsen authored Mar 6, 2023
1 parent a6eabac commit 8201e4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qbittorrent-prune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ fi
# Iterate thru each comma delimited value in QB_CATEGORIES and append torrent hash to array based on filters
torrent_hashes=()
for category in ${QB_CATEGORIES//,/ }; do
hash=$(${CURL_CMD} --fail --cookie "SID=${cookie}" "${api_url}/torrents/info?filter=completed" | jq -r --arg CATEGORY "${category}" '.[] | select( (.category==$CATEGORY) and (.state=="stalledUP") ) | .hash' && printf '\0')
torrent_hashes+=("${hash}")
hash=$(${CURL_CMD} --fail --cookie "SID=${cookie}" "${api_url}/torrents/info?filter=completed" | jq -r --arg CATEGORY "${category}" '.[] | select( (.category==$CATEGORY) and (.state=="stalledUP") ) | .hash')
torrent_hashes+=(${hash[@]})
done

# Exit if no torrents are found in categories
Expand Down

0 comments on commit 8201e4e

Please sign in to comment.