Explorar el Código

Clear the cache on operations the update the disk

Zachary Kotlarek hace 12 años
padre
commit
6215428af4
Se han modificado 3 ficheros con 20 adiciones y 1 borrados
  1. 10 1
      web/includes/season.php
  2. 3 0
      web/includes/series.php
  3. 7 0
      web/includes/util.php

+ 10 - 1
web/includes/season.php

@@ -105,6 +105,9 @@ function saveSeasons($series, $data, $series_last, $seasons_last) {
 		}
 
 	}
+
+	# Force a cache update
+	clearCache();
 }
 
 # Add the specified season folder
@@ -136,7 +139,10 @@ function addSeason($series, $season) {
 	}
 
 	# Create the directory
-	mkdir($season_path);
+	@mkdir($season_path);
+
+	# Force a cache update
+	clearCache();
 }
 
 # Remove the specified season folder, if possible (i.e. if empty)
@@ -155,6 +161,9 @@ function delSeason($series, $season) {
 
 	# Remove the directory (or fail silently)
 	@rmdir(seasonPath($series, $season));
+
+	# Force a cache update
+	clearCache();
 }
 
 ?>

+ 3 - 0
web/includes/series.php

@@ -183,6 +183,9 @@ function saveFlags($series, $data, $series_last, $seasons_last) {
 			}
 		}
 	}
+
+	# Force a cache update
+	clearCache();
 }
 
 # Add a series as identified by TVDB URL or ID

+ 7 - 0
web/includes/util.php

@@ -52,4 +52,11 @@ function displayTitle($title) {
 	return $title;
 }
 
+function clearCache() {
+	global $CACHE_FILE;
+	if (file_exists($CACHE_FILE)) {
+		unlink($CACHE_FILE);
+	}
+}
+
 ?>