From 8917d7c16c13f288d6645a48cd124dae1d92b4ee Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 14 Aug 2013 16:47:59 +0200 Subject: [PATCH] Optimize movie.list query --- couchpotato/core/plugins/movie/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/couchpotato/core/plugins/movie/main.py b/couchpotato/core/plugins/movie/main.py index 0e6ef133..824633f3 100644 --- a/couchpotato/core/plugins/movie/main.py +++ b/couchpotato/core/plugins/movie/main.py @@ -200,7 +200,8 @@ class MoviePlugin(Plugin): q = q.subquery() q2 = db.query(Movie).join((q, q.c.id == Movie.id)) \ - .options(joinedload_all('releases')) \ + .options(joinedload_all('releases.files')) \ + .options(joinedload_all('releases.info')) \ .options(joinedload_all('profile.types')) \ .options(joinedload_all('library.titles')) \ .options(joinedload_all('library.files')) \