From bc6710221d2a2eb94de51f4213bc11f7a146d998 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Mon, 21 Jan 2013 19:07:12 +0000 Subject: [PATCH] Match [XXxYY] number scheme --- source/lib/DownloadDispatcher/Source/Plugin/TV.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php index d787cbf..6a0457c 100644 --- a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php +++ b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php @@ -141,7 +141,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug protected function normalise($name) { $normalised_name = $name; - if (preg_match('/(?:\[ www.[a-zA-Z0-9.]+ \] - )?(.*?)([\s.]+us)?([\s\.](19|20)\d{2})?[\s\.](\d+x\d+|s(?:eason ?)?\d+[.-_ ]?e(?:pisode ?)?\d+|\d{3,4}).*/i', $normalised_name, $matches)) { + if (preg_match('/(?:\[ www.[a-zA-Z0-9.]+ \] - )?(.*?)([\s.]+us)?([\s\.](19|20)\d{2})?[\s\.](\[?\s*\d+x\d+\s*\]?|s(?:eason ?)?\d+[.-_ ]?e(?:pisode ?)?\d+|\d{3,4}).*/i', $normalised_name, $matches)) { $normalised_name = $matches[1]; } @@ -165,7 +165,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug return null; }; - if (preg_match('/(\d+)\d{2}(?!\d|[\s\.](?:\d+x\d+|s\d+[._-]?ep?\d+))|(\d+)x\d+|s(?:season ?)?(\d+)e(?:pisode ?)?\d+|season (\d+)/i', $name, $matches)) { + if (preg_match('/(\d+)\d{2}(?!\d|[\s\.](?:\d+x\d+|s\d+[._-]?ep?\d+))|\[?\s*(\d+)x\d+\s*\]?|s(?:season ?)?(\d+)e(?:pisode ?)?\d+|season (\d+)/i', $name, $matches)) { return $set_season($matches); } else { return 0; @@ -182,7 +182,7 @@ class DownloadDispatcher_Source_Plugin_TV extends DownloadDispatcher_Source_Plug return null; }; - if (preg_match('/\d+(\d{2})(?!\d|[\s\.](?:\d+x\d+|s\d[._-]?+ep?\d+))|\d+x(\d+)|s(?:eason ?)?\d+e(?:pisode ?)?(\d+)|^(\d{1,2})/i', $name, $matches)) { + if (preg_match('/\d+(\d{2})(?!\d|[\s\.](?:\d+x\d+|s\d[._-]?+ep?\d+))|\[?\s*\d+x(\d+)\s*\]?|s(?:eason ?)?\d+e(?:pisode ?)?(\d+)|^(\d{1,2})/i', $name, $matches)) { return $set_episode($matches); } else { return 0;