Просмотр исходного кода

Allow access to the series list without season data

Zachary Kotlarek 13 лет назад
Родитель
Сommit
050fec7b2d
2 измененных файлов с 15 добавлено и 4 удалено
  1. 1 1
      web/includes/display.php
  2. 14 3
      web/includes/series.php

+ 1 - 1
web/includes/display.php

@@ -101,7 +101,7 @@ function printSeries($series) {
 # Print a DL of all series and note the available and monitored seasons
 # Print a DL of all series and note the available and monitored seasons
 function printAllSeries() {
 function printAllSeries() {
 	global $TV_PATH;
 	global $TV_PATH;
-	$all_series = allSeries($TV_PATH);
+	$all_series = allSeriesSeasons($TV_PATH);
 
 
 	# Display all series
 	# Display all series
 	echo '<dl>';
 	echo '<dl>';

+ 14 - 3
web/includes/series.php

@@ -11,7 +11,19 @@ function seriesPath($series) {
 	return $TV_PATH . '/' . $series;
 	return $TV_PATH . '/' . $series;
 }
 }
 
 
-# Find all seriess under the given path
+# Find all series and seasons under a given path
+function allSeriesSeasons($base) {
+	$retval = array();
+	$all_series = allSeries($base);
+
+	foreach ($all_series as $series) {
+		$retval[ $series ] = findSeasons($series);
+	}
+
+	return $retval;
+}
+
+# Find all series under the given path
 function allSeries($base) {
 function allSeries($base) {
 	$retval = array();
 	$retval = array();
 
 
@@ -32,8 +44,7 @@ function allSeries($base) {
 			continue;
 			continue;
 		}
 		}
 
 
-		# Record the series title and look for season folders
-		$retval[ $series ] = findSeasons($series);
+		$retval[] = $series;
 	}
 	}
 	closedir($tv_dir);
 	closedir($tv_dir);