diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2014-11-25 20:24:30 +0100 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2014-11-25 20:24:30 +0100 |
commit | 42411217a9a12d7fae7ec2b5fe6f0f8ee43c5d42 (patch) | |
tree | 1ea56b5c54d410996c8caa2fcb5e43d2db74dd27 /imdb-lookup/imdbinfo.py | |
parent | 11abdc80ba99b7e2456a4d85b187e2d07406ebb2 (diff) | |
download | scripts-42411217a9a12d7fae7ec2b5fe6f0f8ee43c5d42.tar.gz scripts-42411217a9a12d7fae7ec2b5fe6f0f8ee43c5d42.zip |
list files
Diffstat (limited to 'imdb-lookup/imdbinfo.py')
-rwxr-xr-x | imdb-lookup/imdbinfo.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/imdb-lookup/imdbinfo.py b/imdb-lookup/imdbinfo.py index caf00a4..259b2c6 100755 --- a/imdb-lookup/imdbinfo.py +++ b/imdb-lookup/imdbinfo.py @@ -140,7 +140,7 @@ class Protector(object): if callable(attr): return protected else: - return o + return attr def do_aka(args, imdb_ids): with TMDBCache() as tmdbcache: @@ -178,6 +178,12 @@ def do_rating(args, imdb_ids): def do_index(args, imdb_ids): """creates a index website""" + def listMovieFiles(path): + for root, dirs, files in os.walk(path): + for curfile in files: + if sum(map(curfile.endswith, [".mkv", ".avi", ".mov", ".mp4"])): + yield os.path.join(root, curfile) + def asBase64(poster): contentType, data = poster data64 = filter(lambda c: c!='\n', base64.encodestring(data)) @@ -197,6 +203,7 @@ def do_index(args, imdb_ids): 'title' : 'Movie overview', 'urlencode' : urlencode, 'int' : int, + 'listMovieFiles' : listMovieFiles, } assert not os.path.exists("index.html"), "index.html already exists" stream = template.generate(mapping) |