Explorar el Código

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 hace 13 años
padre
commit
47558d6ae9
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      dmx/rifftrax.pl

+ 8 - 1
dmx/rifftrax.pl

@@ -163,7 +163,11 @@ while (1) {
 		}
 
 		# 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) {
 				print STDERR 'Matched RIFF: ' . $title . ' => ' . $RIFFS{$title}->{'file'} . "\n";
 			}
@@ -383,6 +387,9 @@ sub parseConfig($$) {
 			if ($text =~ /^\s*Name:\s*(\S.*\S)\s*$/mi) {
 				$data{'name'} = $1;
 			}
+			if ($text =~ /^\s*Year:\s*(\d{4})\s*$/mi) {
+				$data{'year'} = $1;
+			}
 			if ($text =~ /^\s*File:\s*(\S.*\S)\s*$/mi) {
 				$data{'file'} = $1;
 			}