Skip to content

Commit

Permalink
fix $to_get calculation, should fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Beavis committed Dec 28, 2020
1 parent fde1476 commit 5ad134d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tv_grab_fr_telerama
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2.6 bug fix :
* fix bad sub-title containing newlines.
2.7 bug fix :
* fix bad $to_get calculation (causing progress bar already finished warning)
=cut
use XMLTV::Usage <<END
$0: get French television listings in XMLTV format
Expand All @@ -313,7 +315,7 @@ use warnings;
use strict;

use utf8;
use XMLTV::Version '$Id: tv_grab_fr_telerama,v 2.6 2020/12/28 09:30:00 zubrick Exp $ ';
use XMLTV::Version '$Id: tv_grab_fr_telerama,v 2.7 2020/12/28 11:30:00 zubrick Exp $ ';
#use XMLTV::Capabilities qw/baseline manualconfig cache/;
use XMLTV::Capabilities qw/baseline manualconfig/;
use XMLTV::Description 'France (telerama)';
Expand Down Expand Up @@ -791,7 +793,7 @@ foreach my $chid (sort { $a <=> $b } keys %channels) {

# count needed api calls
my $nb_chans = scalar(keys %channels);
my $to_get = int($nb_chans / $group_size + 0.5) * ($opt_days - $opt_offset);
my $to_get = (int($nb_chans / $group_size) + ($nb_chans % $group_size > 0 ? 1 : 0)) * ($opt_days - $opt_offset);
my $bar = new XMLTV::ProgressBar('getting listings', $to_get) if not $opt_quiet and not $show_url;

Date_Init('SetDate=now,UTC');
Expand Down

0 comments on commit 5ad134d

Please sign in to comment.