diff options
Diffstat (limited to 'movietool/__init__.py')
-rwxr-xr-x | movietool/__init__.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/movietool/__init__.py b/movietool/__init__.py index 33a0a5a..6084c70 100755 --- a/movietool/__init__.py +++ b/movietool/__init__.py @@ -345,8 +345,15 @@ def do_index(args, imdb_ids): out = os.path.join("movies-files/poster", imdb_id+".jpg") open(out, "wb").write(data) return out - else: - return None + return None + + def poster_grid(imdb_id): + data = db.poster_low(imdb_id, format="w154") + if data: + out = os.path.join("movies-files/poster", imdb_id+"-grid.jpg") + open(out, "wb").write(data) + return out + return None def compile_summary(imdb, omdb, tmdb): buf = [] @@ -373,6 +380,7 @@ def do_index(args, imdb_ids): 'title': tmdb['title'], 'summary': compile_summary(imdb, omdb, tmdb), 'poster': poster(imdb_id), + 'posterGrid': poster_grid(imdb_id), 'tagline': 'tagline' in imdb and imdb['tagline'] or None, 'plot': 'plot' in imdb and imdb['plot']['outline'] or None, 'website': 'homepage' in imdb and imdb['homepage'] or omdb['Website'] != 'N/A' and omdb['Website'] or None, @@ -393,8 +401,10 @@ def do_index(args, imdb_ids): datadir = os.path.join(os.path.dirname(__file__), "html") index_files = os.path.join(datadir, "movies-files") index_html = os.path.join(datadir, "movies.html") + index_html_grid = os.path.join(datadir, "movies-grid.html") shutil.copytree(index_files, "movies-files", copy_function=shutil.copyfile) shutil.copyfile(index_html, "movies.html") + shutil.copyfile(index_html_grid, "movies-grid.html") os.mkdir("movies-files/poster") write_data("dataCb") |