From 872e2ef8d0a31128799fcc9c624f8b9a518818ce Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Sun, 10 Feb 2013 21:57:12 +0000 Subject: [PATCH] Fix season/episode detection of shows with a year in the name (remakes) --- source/lib/DownloadDispatcher/Source/Plugin/TV.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php index 6a0457c..d98a14f 100644 --- a/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php +++ b/source/lib/DownloadDispatcher/Source/Plugin/TV.class.php @@ -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+))|\[?\s*(\d+)x\d+\s*\]?|s(?:season ?)?(\d+)e(?:pisode ?)?\d+|season (\d+)/i', $name, $matches)) { + if (preg_match('/(?:(?:[\s\.](?:19|20)\d{2})?[\s\.])?(?:(\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+))|\[?\s*\d+x(\d+)\s*\]?|s(?:eason ?)?\d+e(?:pisode ?)?(\d+)|^(\d{1,2})/i', $name, $matches)) { + if (preg_match('/(?:(?:[\s\.](?:19|20)\d{2})?[\s\.])?(?:\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;