Skip to content

Commit

Permalink
Report in verbose mode when enclosure length is unknown/invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
mlj committed May 4, 2017
1 parent f6d4f29 commit 153afdf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/castget.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void update_callback(void *user_data, channel_action action,
enclosure->filename, enclosure->length,
channel_info->title);
} else {
g_printf(" * Downloading %s from %s\n",
g_printf(" * Downloading %s (unknown length) from %s\n",
enclosure->filename,
channel_info->title);
}
Expand Down Expand Up @@ -325,8 +325,11 @@ static void catchup_callback(void *user_data, channel_action action, channel_inf
g_assert(enclosure);

if (verbose)
g_printf("Catching up on %s (%ld bytes) from %s\n", enclosure->url, enclosure->length,
channel_info->title);
if (enclosure->length > 0)
g_printf("Catching up on %s (%ld bytes) from %s\n", enclosure->url, enclosure->length,
channel_info->title);
else
g_printf("Catching up on %s (unknown length) from %s\n", enclosure->url, channel_info->title);
break;

case CCA_ENCLOSURE_DOWNLOAD_END:
Expand Down

0 comments on commit 153afdf

Please sign in to comment.