Browse Source

Abort if we do not find all the videos

Zachary Kotlarek 11 years ago
parent
commit
cc218d1196
1 changed files with 11 additions and 4 deletions
  1. 11 4
      yt/subscribe.pl

+ 11 - 4
yt/subscribe.pl

@@ -1036,10 +1036,17 @@ sub findVideos($) {
 		}
 	}
 
-	if ($DEBUG) {
-		print STDERR 'Found ' . scalar(keys(%videos)) . " remote videos\n";
-		if ($DEBUG > 1) {
-			print STDERR prettyPrint(\%videos, "\t") . "\n";
+	# Sanity check/debug
+	{
+		my $count = scalar(keys(%videos));
+		if ($DEBUG) {
+			print STDERR 'Found ' . $count . " remote videos\n";
+			if ($DEBUG > 1) {
+				print STDERR prettyPrint(\%videos, "\t") . "\n";
+			}
+		}
+		if ($totalCount != $count) {
+			die('Found only ' . $count . ' of ' . $totalCount . " remote videos. Aborting...\n");
 		}
 	}