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();
|
$matches = array();
|
||||||
$identifier = null;
|
$identifier = null;
|
||||||
foreach ($output as $line) {
|
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
|
# This line is an identifier
|
||||||
$identifier = $matches[1];
|
$identifier = $matches[1];
|
||||||
$currentEpisodes[$identifier] = array();
|
$currentEpisodes[$identifier] = array();
|
||||||
} else {
|
} else {
|
||||||
# This line is an entry for the current identifier
|
# 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'";
|
$errors[] = "Ignored unmatched line '$line'";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user