فهرست منبع

Make the number of next episodes selectable at runtime. Increase the default from 2 to 3.

Zachary Kotlarek 13 سال پیش
والد
کامیت
e6dc5a7ca5
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      findTorrent.pl

+ 7 - 1
findTorrent.pl

@@ -8,6 +8,7 @@ my $NO_QUALITY_CHECKS   = 0;
 my $MORE_NUMBER_FORMATS = 0;
 my $MIN_DAYS_BACK       = 0;
 my $MAX_DAYS_BACK       = 3;
+my $NEXT_EPISODES       = 3;
 
 # Local config
 my $TV_DIR = `~/bin/video/mediaPath` . '/TV';
@@ -62,6 +63,9 @@ if ($ENV{'MIN_DAYS_BACK'}) {
 if ($ENV{'MAX_DAYS_BACK'}) {
 	$MAX_DAYS_BACK = $ENV{'MAX_DAYS_BACK'};
 }
+if ($ENV{'NEXT_EPISODES'}) {
+	$NEXT_EPISODES = $ENV{'NEXT_EPISODES'};
+}
 
 # New fetch object
 my $cookies = mktemp('/tmp/findTorrent.cookies.XXXXXXXX');
@@ -376,7 +380,9 @@ if (scalar(@urls) < 1) {
 
 	# Assume we need the next 2 episodes, unless no_next is set (i.e. season_done)
 	if (!$no_next) {
-		@need = ($highest + 1, $highest + 2);
+		for (my $i = 1; $i <= $NEXT_EPISODES; $i++) {
+			push(@need, $highest + $i);
+		}
 	}
 
 	# Find any missing episodes