From a1edb76cb2cd074c6e22e471529515d0d55f1264 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Tue, 5 Jul 2011 22:28:29 +0100 Subject: [PATCH] Update regex for new --series output --- mt.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mt.php b/mt.php index 5c9f0ff..c60b428 100644 --- a/mt.php +++ b/mt.php @@ -184,13 +184,14 @@ if (!$returnValue) { $output = array_slice($output, 2, -2); /* - Name Latest Status - ------------------------------------------------------------------------------- - castle s02e10 *hdtv-Proper + * Name Latest Status + * ------------------------------------------------------------------------------- + * Castle S03E24 - 49d 7h *720p + * */ foreach ($output as $line) { $matches = array(); - if (!preg_match('/^\s(?P.{1,30})\s+(?P.{1,20})\s+(?P.*)\s+/', $line, $matches)) { + if (!preg_match('/^\s(?P.{1,30})\s+(?P.{1,20}?)( - (?P[0-9dhms ]+))?\s+(?P.*)\s+/', $line, $matches)) { $errors[] = "Failed to parse '$line'"; continue; }