From fdd16f2d62736c0b29b187f1711041cd83b321c6 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Wed, 31 Oct 2012 03:14:24 +0000 Subject: [PATCH] Properly delete .avi_high.mp4 files. --- playonwii/functions.php | 12 ++++++++++++ src/rtv_delete.py | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/playonwii/functions.php b/playonwii/functions.php index 0a2ec80..6bf4a1f 100644 --- a/playonwii/functions.php +++ b/playonwii/functions.php @@ -16,9 +16,21 @@ function prepare_filename( $filename ) $extension = substr( $filename, $dotpos ); $filename = substr( $filename, 0, $dotpos ); + if ( $extension == ".mp4" ) + { + $dotpos = strrpos( $filename, '.' ); + $tmp = substr( $filename, $dotpos ); + if ( $tmp == ".avi_high" ) + { + $extension = $tmp . $extension; + $filename = substr( $filename, 0, $dotpos ); + } + } + if ( $extension != ".flv" and $extension != ".avi" and $extension != ".mp4" and + $extension != ".avi_high.mp4" and $extension != ".webm" ) { return "not_an_flv"; diff --git a/src/rtv_delete.py b/src/rtv_delete.py index f33c309..990b3f7 100644 --- a/src/rtv_delete.py +++ b/src/rtv_delete.py @@ -14,6 +14,11 @@ def _delete_file( base_dir, filename ): print mp3path os.remove( mp3path ) + mp4path = fullpath + "_high.mp4" + if os.path.isfile( mp4path ): + print mp4path + os.remove( mp4path ) + def collect_walk_no_slashes( top_dir ): len_top_dir = len( top_dir ) + 1 ret = {} -- 2.11.4.GIT