Added enhanced diagnostics for torrent list retrieval

- Added verbose logging to identify when no torrents are found
- Added raw transmission command output logging to troubleshoot connection issues
- Improved tracking of torrent ID extraction from command output
- Made torrent count always visible, not just in debug mode

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-03-04 18:12:11 +01:00
parent e64e1115a7
commit 1119f38fd6
2 changed files with 30 additions and 5 deletions
+8 -1
View File
@@ -118,11 +118,18 @@ main() {
log_debug "Getting list of torrents..."
local torrent_ids
torrent_ids=$(get_torrents)
log_debug "Found $(echo "$torrent_ids" | wc -l) torrents"
log_info "Found $(echo "$torrent_ids" | wc -l) torrents"
# Use a regular for loop instead of a pipe to while
# to avoid the subshell issue that causes processed_source_dirs to be lost
readarray -t torrent_ids_array <<< "$torrent_ids"
# Print the torrent IDs to debug (always, not just in debug mode)
if [[ ${#torrent_ids_array[@]} -eq 0 ]]; then
log_info "No torrents found to process"
else
log_info "Torrent IDs to process: ${torrent_ids_array[*]}"
fi
for id in "${torrent_ids_array[@]}"; do
# Skip empty IDs
if [[ -z "$id" ]]; then