Explorar el Código

Match episodes with date numbers

Zachary Kotlarek hace 9 años
padre
commit
524c5c59d8
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      web/includes/episode.php

+ 4 - 1
web/includes/episode.php

@@ -20,7 +20,10 @@ function findEpisodes($series, $season) {
 		}
 
 		# Record the episode number
-		if (preg_match('/^(?:S\d+E)?(\d+)\s*\-\s*(\S.*\.\w{2,4})$/i', $episode, $matches)) {
+		if (preg_match('/^(20\d\d)\-(\d\d)\-(\d\d)\s*\-\s*(\S.*\.\w{2,4})$/i', $episode, $matches)) {
+			$episode_num = intval($matches[1] . $matches[2] . $matches[3]);
+			$retval[ $episode_num ] = $matches[4];
+		} elseif (preg_match('/^(?:S\d+E)?(\d+)\s*\-\s*(\S.*\.\w{2,4})$/i', $episode, $matches)) {
 			$episode_num = intval($matches[1]);
 			$retval[ $episode_num ] = $matches[2];
 		}