Updated regexes for --series foo output
This commit is contained in:
4
mt.php
4
mt.php
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user