Filter out unprocessed media.
authorDavid Thompson <davet@gnu.org>
Tue, 31 Mar 2015 18:45:18 +0000 (14:45 -0400)
committerDavid Thompson <davet@gnu.org>
Tue, 31 Mar 2015 18:45:18 +0000 (14:45 -0400)
mediagoblin_libreplanet/__init__.py
mediagoblin_libreplanet/views.py

index 6ae6c4a..d06b6be 100644 (file)
@@ -41,7 +41,8 @@ def setup_plugin():
 
 def lp_media_for_type(db, type):
     return media_entries_for_tag_slug(db, LP_TAG).\
-        filter(MediaEntry.media_type == type).\
+        filter((MediaEntry.media_type == type)
+               & (MediaEntry.state == u'processed')).\
         order_by(MediaEntry.created.desc()).\
         limit(MAX_HOME_ITEMS)
 
index 78e4d0e..832ba14 100644 (file)
@@ -21,9 +21,10 @@ from mediagoblin.tools.pagination import Pagination
 from mediagoblin.tools.response import render_to_response
 from mediagoblin.decorators import uses_pagination
 
-def type_listing(type, title, request, page):
+def type_listing(media_type, title, request, page):
     cursor = MediaEntry.query.\
-             filter(MediaEntry.media_type == type).\
+             filter((MediaEntry.media_type == media_type)
+                    & (MediaEntry.state == u'processed')).\
              order_by(MediaEntry.created.desc())
 
     pagination = Pagination(page, cursor)