Zachary Kotlarek 14 лет назад
Родитель
Сommit
257649be2c
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      plexMonitor/plexMonitor.pl

+ 7 - 2
plexMonitor/plexMonitor.pl

@@ -50,16 +50,21 @@ if (!-d $DATA_DIR) {
 }
 
 # Loop forever (unless no delay is set)
+my $data     = '';
 my $dataLast = '';
 do {
-	my $changed = 0;
 
 	# Run the monitor command
-	my $data = xbmcHTTP($CMDS{$MODE});
+	my $changed = 0;
+	$dataLast = $data;
+	$data     = xbmcHTTP($CMDS{$MODE});
 
 	# Compare this data set to the last
 	if ($data ne $dataLast) {
 		$changed = 1;
+		if ($DEBUG) {
+			print STDERR "Change detected in data:\n" . $data . "\n";
+		}
 	}
 
 	# If anything changed, save the data to disk