Update regex for new --series output

This commit is contained in:
2011-07-05 22:28:29 +01:00
parent 1af381b051
commit a1edb76cb2

9
mt.php
View File

@@ -184,13 +184,14 @@ if (!$returnValue) {
$output = array_slice($output, 2, -2); $output = array_slice($output, 2, -2);
/* /*
Name Latest Status * Name Latest Status
------------------------------------------------------------------------------- * -------------------------------------------------------------------------------
castle s02e10 *hdtv-Proper * Castle S03E24 - 49d 7h *720p
*
*/ */
foreach ($output as $line) { foreach ($output as $line) {
$matches = array(); $matches = array();
if (!preg_match('/^\s(?P<series>.{1,30})\s+(?P<episode>.{1,20})\s+(?P<quality>.*)\s+/', $line, $matches)) { if (!preg_match('/^\s(?P<series>.{1,30})\s+(?P<episode>.{1,20}?)( - (?P<elapsed>[0-9dhms ]+))?\s+(?P<quality>.*)\s+/', $line, $matches)) {
$errors[] = "Failed to parse '$line'"; $errors[] = "Failed to parse '$line'";
continue; continue;
} }