diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2014-12-21 23:00:40 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2014-12-21 23:00:40 +0100 |
commit | 6033e5b6534551f28fb14467a6c01c48bc136880 (patch) | |
tree | 614cd277038db5393ca0b4572a88d6edd0029621 /imdb-lookup/imdbinfo.py | |
parent | 02afa4a99fcb9e899e786357254708402a7b73ef (diff) | |
download | scripts-6033e5b6534551f28fb14467a6c01c48bc136880.tar.gz scripts-6033e5b6534551f28fb14467a6c01c48bc136880.zip |
path
Diffstat (limited to 'imdb-lookup/imdbinfo.py')
-rwxr-xr-x | imdb-lookup/imdbinfo.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py index 6318bfb..7457c98 100755 --- a/imdb-lookup/imdbinfo.py +++ b/imdb-lookup/imdbinfo.py @@ -292,10 +292,15 @@ def do_index(args, imdb_ids): valid_extensions = [".mkv", ".avi", ".mov", ".mp4", ".mpg"] def listMovieFiles(path): - for root, dirs, files in os.walk(path): - for curfile in files: - if sum(map(curfile.endswith, valid_extensions)): - yield os.path.join(root, curfile) + def listFiles(): + for root, dirs, files in os.walk(path): + for curfile in files: + if sum(map(curfile.endswith, valid_extensions)): + yield os.path.join(root, curfile) + files = list(listFiles()) + if not files: + files = [path] + return files def install(filename): outpath = os.path.join(".index.html", os.path.dirname(filename)) |