Browse Source

Allow empty results in single-item queries

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

+ 1 - 2
yt/subscribe.pl

@@ -982,11 +982,10 @@ sub getVideoData($) {
 	if (   exists($data->{'pageInfo'})
 		&& ref($data->{'pageInfo'}) eq 'HASH'
 		&& exists($data->{'pageInfo'}->{'totalResults'})
-		&& $data->{'pageInfo'}->{'totalResults'} > 0
 		&& exists($data->{'items'})
 		&& ref($data->{'items'}) eq 'ARRAY')
 	{
-		if ($data->{'pageInfo'}->{'totalResults'} != scalar(@{$ids})) {
+		if (scalar(@{$ids}) > 1 && $data->{'pageInfo'}->{'totalResults'} != scalar(@{$ids})) {
 			die('Video/metadata search count mismatch: ' . $data->{'pageInfo'}->{'totalResults'} . '/' . scalar(@{$ids}) . "\n");
 		}
 		$data = $data->{'items'};