Browse Source

retry on new, not on queue_new

themage
theMage 4 years ago
parent
commit
3ae47b14f3
1 changed files with 5 additions and 4 deletions
  1. 5 4
      lib/CinePantufas/Core.pm

+ 5 - 4
lib/CinePantufas/Core.pm

@ -290,6 +290,11 @@ sub __cmd_get_new {
290 290
        my $k = $show.';:;'.$episode->{number};
291 291
        if ($epidb{$k}) {
292 292
          my $old = from_json($epidb{$k},{utf8=>1});
293
          
294
          if ($old->{status} eq 'failed' and rand(20)>19) {
295
            $old->{status} = 'new';
296
            $old->{prio} = -100;
297
          }
293 298
          next unless $old->{status} eq 'new';
294 299
          next unless $episode->{prio} > $old->{prio};
295 300
        }
@ -338,10 +343,6 @@ sub __queue_new {
338 343
  EPISODE:
339 344
  for my $k (sort keys %epidb) {
340 345
    my $episode = from_json($epidb{$k}, {utf8=>1});
341
    if ($episode->{status} eq 'failed' and rand(20)>19) {
342
      $episode->{status} = 'new';
343
      $episode->{failed} = 0;
344
    }
345 346
    next unless $episode->{status} eq 'new';
346 347
347 348
    for my $link (@{$episode->{torrents}} ) {