summaryrefslogtreecommitdiff
path: root/movietool/__init__.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2015-03-30 00:22:47 +0200
committerYves Fischer <yvesf-git@xapek.org>2015-03-30 00:22:47 +0200
commit1212430927e2ae20874eacbae5915c40a7e9bee2 (patch)
tree72ad4dacc5ba60a5853067643dfa23f0008976e1 /movietool/__init__.py
parent3c0d14ee39432705f9937ae4ac7a149d19ae4f1c (diff)
downloadmovietool-1212430927e2ae20874eacbae5915c40a7e9bee2.tar.gz
movietool-1212430927e2ae20874eacbae5915c40a7e9bee2.zip
grid variant
Diffstat (limited to 'movietool/__init__.py')
-rwxr-xr-xmovietool/__init__.py14
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")