Просмотр исходного кода

Validate title matches by year, if provided. This does not allow RiffTrax for multiple movies with the same title, but it allows us to avoid mis-detecing the wrong movie.

Zachary Kotlarek 13 лет назад
Родитель
Сommit
47558d6ae9
1 измененных файлов с 8 добавлено и 1 удалено
  1. 8 1
      dmx/rifftrax.pl

+ 8 - 1
dmx/rifftrax.pl

@@ -163,7 +163,11 @@ while (1) {
 		}
 		}
 
 
 		# Activate a new RIFF, if applicable
 		# Activate a new RIFF, if applicable
-		if ($RIFFS{$title}) {
+		# Always match on title, validate year if provided
+		if ($RIFFS{$title}
+			&& (!exists($RIFFS{$title}{'year'}) || $RIFFS{$title}{'year'} eq $exists{'PLAYING_YEAR'}))
+		{
+
 			if ($DEBUG) {
 			if ($DEBUG) {
 				print STDERR 'Matched RIFF: ' . $title . ' => ' . $RIFFS{$title}->{'file'} . "\n";
 				print STDERR 'Matched RIFF: ' . $title . ' => ' . $RIFFS{$title}->{'file'} . "\n";
 			}
 			}
@@ -383,6 +387,9 @@ sub parseConfig($$) {
 			if ($text =~ /^\s*Name:\s*(\S.*\S)\s*$/mi) {
 			if ($text =~ /^\s*Name:\s*(\S.*\S)\s*$/mi) {
 				$data{'name'} = $1;
 				$data{'name'} = $1;
 			}
 			}
+			if ($text =~ /^\s*Year:\s*(\d{4})\s*$/mi) {
+				$data{'year'} = $1;
+			}
 			if ($text =~ /^\s*File:\s*(\S.*\S)\s*$/mi) {
 			if ($text =~ /^\s*File:\s*(\S.*\S)\s*$/mi) {
 				$data{'file'} = $1;
 				$data{'file'} = $1;
 			}
 			}