diff -r 16312d0021cb -r d616e308f6b6 gmyth-stream/server/lib.py --- a/gmyth-stream/server/lib.py Fri Apr 06 22:58:06 2007 +0100 +++ b/gmyth-stream/server/lib.py Wed Apr 11 19:34:21 2007 +0100 @@ -3,6 +3,8 @@ import os import stat +global ext = ['mpg', 'avi', 'mp4', 'nuv', 'mpeg', 'mov'] + def now(): return time.strftime("%Y-%m-%d %H:%M:%S"); @@ -22,4 +24,13 @@ return path return "" +def list_media_files(directory, file_list): + for root, dirs, files in os.walk(directory): + for name in files: + if os.path.splitext(name)[1].strip(".") in ext: + media = os.path.join(root,name) + if media not in file_list + file_list.append(os.path.join(root,name)) + return True +