Updated regexes for --series foo output

This commit is contained in:
2011-07-05 23:06:04 +01:00
parent a1edb76cb2
commit d0f213f989

4
mt.php
View File

@@ -142,13 +142,13 @@ if (isset($_POST['action'])) {
$matches = array();
$identifier = null;
foreach ($output as $line) {
if (preg_match('/^\s(s\d\de\d\d|\d+)\s*$/i', $line, $matches)) {
if (preg_match('/^\s(s\d\de\d\d|\d+)( - ([0-9dhms ]+))?\s*$/i', $line, $matches)) {
# This line is an identifier
$identifier = $matches[1];
$currentEpisodes[$identifier] = array();
} else {
# This line is an entry for the current identifier
if (!preg_match('/\s(.)\s+(.*)\s+(.*)\s*$/', $line, $matches)) {
if (!preg_match('/^\s+(\*?)\s+(.{1,64}?)\s+(\S+)\s*$/', $line, $matches)) {
$errors[] = "Ignored unmatched line '$line'";
continue;
}