瀏覽代碼

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