Browse Source

Prefer the search results to the extra_videos.ini file, if a video ID exists in both

Zachary Kotlarek 12 năm trước cách đây
mục cha
commit
b1984076b7
1 tập tin đã thay đổi với 7 bổ sung và 0 xóa
  1. 7 0
      yt/subscribe.pl

+ 7 - 0
yt/subscribe.pl

@@ -539,6 +539,13 @@ sub addExtras($$) {
 	my ($dir, $videos) = @_;
 	my ($dir, $videos) = @_;
 	my $extras = readExtras($dir);
 	my $extras = readExtras($dir);
 	foreach my $id (keys(%{$extras})) {
 	foreach my $id (keys(%{$extras})) {
+		if (exists($videos->{$id})) {
+			if ($DEBUG > 1) {
+				print STDERR 'Skipping known video: ' . $id . "\n";
+			}
+			next;
+		}
+
 		my $video = findVideo($id);
 		my $video = findVideo($id);
 		$video->{'number'} = $extras->{$id};
 		$video->{'number'} = $extras->{$id};
 		$videos->{$id} = $video;
 		$videos->{$id} = $video;